[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.technology.jsr220-orm] Re: Have you ever tried to run hibernate EntityManager from inside a plugin ?

Hi Thomas,

This does sound very much like a eclipse classloader issue. From Hibernate docs:
" When Persistence.createEntityManagerFactory() is called, the persistence implementation will search your classpath for any META-INF/persistence.xml files using the ClassLoader.getResource("META-INF/persistence.xml") method. From this list of resources, it will try to find a entity manager that matches the name you specify in the command line with what is specified in the persistence.xml file. If no persistence.xml with the correct name are found, a PersistenceException is raised. If there is only one persistence.xml in your classpath, you don't have to declare any entity manager factory name (however, if several files are found, a PersistenceException is raised)."



You should be able to get the javax.persistence sources from Hibernate. The EJB3 spec is not final, so all vendors have their own implementations of these classes to use in their EJB3 previews. I've had some trouble in the past trying to get Hibernate to recognize a persistence.xml that is not in a jar/par. These questions will be better answered by the Hibernate guys I think.


Dirk le Roux