Skip to main content


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 18:11 Go to next message
Ignacio M is currently offline Ignacio MFriend
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 16:18 Go to previous message
Ignacio M is currently offline Ignacio MFriend
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 24 18:54:48 GMT 2024

Powered by FUDForum. Page generated in 0.03502 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top