ClassLoader Problem [message #636755] |
Tue, 02 November 2010 12:40  |
Eclipse User |
|
|
|
Hi to all,
I've a problem with runtime ClassLoader; this is my situation:
Have a Main project and other sub-projects, everyone with own persistence.xml; a custom ClassLoader load all classes from sub-projects' jars at runtime.
I need to create an EntityManagerFactory ("emf") for every jar loaded, specifing connection parameters, driver ... as ClassLoader set my customClassLoader. When an "emf" is created it has an internal "managedClassList" with entity names read in it's own persistence.xml.
But when create an EntityManager (emf.createEntityManager() or emf.createEntityManager(map)), this has no entities inside. I suppose it's a ClassLoader's problem, it's seems that my custom ClassLoader is not used and the entities that are in "managedClassList" will not be founded.
The problem doesn't exist if insert all sub-projects inside Main probject's libs, instead of load them at runtime.
How can I resolve my problem? Have to specify a particupar property to EntityManagerFactory?
Thanks in advance and good evening,
Roberto
|
|
|
|
Re: ClassLoader Problem [message #637846 is a reply to message #636755] |
Tue, 09 November 2010 02:41  |
Eclipse User |
|
|
|
Yes i set my custom classloader to emf with property: "eclipselink.classloader".
I'm not using OSGi ... what benefit could I get? It could solve my problem?
Thanks for help,
Roberto
|
|
|
Powered by
FUDForum. Page generated in 0.09623 seconds