I'm running out of Eclipse, and I've moved the PAR file all over the place to make sure it was in the CLASSPATH.
At this point I'm not entirely sure if the classpath is the problem. Most of my code and configuration is right out of the User Guide.
Hibernate version:
EntityManager 3.1 beta 4
Mapping documents:
persistence.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<entity-manager>
<name>MediciEntity</name>
<jta-data-source>java:/MediciDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.ejb.cfgfile" value="hibernate.cfg.xml"/>
</properties>
</entity-manager>
This file is in the META-INF directory of a PAR file with the Annotated classes. The classes with their annotations have been working with an
AnnotationConfiguration. However, I'm now trying to load them using the
EntityManager API.
Code between sessionFactory.openSession() and session.close():Code:
Properties properties = new Properties();
EntityManagerFactory emfactory = Persistence.createEntityManagerFactory("MediciEntity",properties);
EntityManager manager = emfactory.createEntityManager();
manager.close();
emfactory.close();
The properties hash is currently empty.
Full stack trace of any exception that occurs:Code:
2005-11-16 19:59:05,468 (INFO ) cfg.Environment - Hibernate 3.1 rc2
2005-11-16 19:59:05,468 (INFO ) cfg.Environment - hibernate.properties not found
2005-11-16 19:59:05,468 (INFO ) cfg.Environment - using CGLIB reflection optimizer
2005-11-16 19:59:05,468 (INFO ) cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
2005-11-16 19:59:05,531 (DEBUG) ejb.Ejb3Configuration - Trying to find persistence unit: MediciEntity
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named MediciEntity
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:41)
at org.ccf.Medici.Accountant.main(Accountant.java:150)