Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink cant find PersistenceUnit
EclipseLink cant find PersistenceUnit [message #385445] Thu, 05 February 2009 13:11 Go to next message
Ignacio M is currently offline Ignacio M
Messages: 20
Registered: July 2009
Junior Member
I'm trying to setup eclipseLink, using the latest code from svn. When I
run the code I get a javax.persistence.PersistenceException: No
persistence provider for EntityManager named punit
Im calling EclipseLink with this line

The call to init goes with the classLoader of the Activator. Like
Activator.class.getClassLoader();

public void init(ClassLoader classLoader)
Map<String, Object> properties = new HashMap<String, Object>();

properties.put(PersistenceUnitProperties.CLASSLOADER, classLoader);
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("punit", properties); <-- Here is
where I get the exception from my code
..
..
}

In Manifest.mf of this bundle that contains persistence.xml

I have JPA-PersistenceUnits: punit

I have tracked the exception trough eclipseLink code and it get another
classLoader on JavaSECMPInitializer at method initializeClassLoader

public void initializeClassLoader(PersistenceInitializationHelper
persistenceHelper){
initializationClassLoader = persistenceHelper(null, null);
}

After this when eclipseLink tries to load persistence.xml file with this
classLoader I get the exception.

I'm been checking many things, any ideas.
Thanks
Re: EclipseLink cant find PersistenceUnit [message #385447 is a reply to message #385445] Fri, 06 February 2009 11:18 Go to previous message
Ignacio M is currently offline Ignacio M
Messages: 20
Registered: July 2009
Junior Member
The thing that was missing here is that I did not have the
javax.persistence package as a dependency for this plugin another
important thing is that you need the 1.99 version that is on eclipseLink
site.
Previous Topic:Too many open files using embedded derby
Next Topic:Problems creating an XML Project from an XML Schema
Goto Forum:
  


Current Time: Wed Apr 16 09:41:44 EDT 2014

Powered by FUDForum. Page generated in 0.02299 seconds