Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » ClassNotFoundException when configuring caching in OSGi environment
ClassNotFoundException when configuring caching in OSGi environment [message #385493] Mon, 23 February 2009 10:13 Go to next message
Joerg Matysiak is currently offline Joerg MatysiakFriend
Messages: 2
Registered: July 2009
Junior Member
Hi,

I'm currently trying to configure eclipselinks' caching for out
application.

I don't want any caching to happen in our JUnit tests, so I specified:

eclipselink.cache.type.default=NONE

in my properties file and got a ClassNotFoundException for the class
org.eclipse.persistence.internal.identitymaps.NoIdentityMap (which is part
of the org.eclipse.persistence.core bundle). - Stacktrace see below

Configuring other values for cache type (e.g. "Full") results in similar
ClassNotFoundExceptions for other classes from the
org.eclipse.persistence.internal.identitymaps package).

The eclipselink bundles are all loaded and they work fine when I remove
the
eclipselink.cache.type.default property from my configuration.

What am I doing wrong?

Best regards,
Joerg


Here's the output I get in stdout and stderr:

[junit] ------------- Standard Output -----------------
[junit] osgi> Persistence bundle starting...
[junit] Persistence bundle started.
[junit] ProviderTracker: New service detected...
[junit] ProviderTracker: Added service
org.eclipse.persistence.jpa.osgi.PersistenceProviderOSGi
[junit] Exception caught: Exception [EclipseLink-28006] (Eclipse
Persistence Services - 1.0.2 (Build 20081024)):
org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
[junit] Exception Description: ClassNotFound:
[org.eclipse.persistence.internal.identitymaps.NoIdentityMap ] specified in
[eclipselink.cache.type.default] property.
[junit] Internal Exception: java.lang.ClassNotFoundException:
org.eclipse.persistence.internal.identitymaps.NoIdentityMap
[junit] Exception caught: Exception [EclipseLink-28006] (Eclipse
Persistence Services - 1.0.2 (Build 20081024)):
org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
[junit] Exception Description: ClassNotFound:
[org.eclipse.persistence.internal.identitymaps.NoIdentityMap ] specified in
[eclipselink.cache.type.default] property.
[junit] Internal Exception: java.lang.ClassNotFoundException:
org.eclipse.persistence.internal.identitymaps.NoIdentityMap
[junit] Initializing database ...
[junit] Setting JPA property: eclipselink.cache.type.default to NONE
[junit] Setting JPA property: log.level to ALL
...



[junit] ------------- Standard Error -----------------
[junit] Local Exception Stack:
[junit] Exception [EclipseLink-28006] (Eclipse Persistence Services -
1.0.2 (Build 20081024)):
org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
[junit] Exception Description: ClassNotFound:
[org.eclipse.persistence.internal.identitymaps.NoIdentityMap ] specified in
[eclipselink.cache.type.default] property.
[junit] Internal Exception: java.lang.ClassNotFoundException:
org.eclipse.persistence.internal.identitymaps.NoIdentityMap
[junit] at
org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on.classNotFoundForProperty(EntityManagerSetupException.java :130)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. findClassForProperty(EntityManagerSetupImpl.java:532)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. updateDescriptorCacheSettings(EntityManagerSetupImpl.java:56 4)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. updateServerSession(EntityManagerSetupImpl.java:1194)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. deploy(EntityManagerSetupImpl.java:237)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.getServerSession(EntityManagerFactoryImpl.java:69)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.createEntityManagerImpl(EntityManagerFactoryImpl.java:118)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.createEntityManagerImpl(EntityManagerFactoryImpl.java:112)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.createEntityManager(EntityManagerFactoryImpl.java:100)
[junit] at
de.cenit.eb.sm.finca.functional.dblayer.events.internal.JpaU tils.createEntityManager(Unknown
Source)
[junit] at
de.cenit.eb.sm.finca.functional.dblayer.events.internal.JpaU tils.create(Unknown
Source)
[junit] at
de.cenit.eb.sm.finca.functional.dblayer.events.internal.Defa ultEventFromDatabaseService.activate(Unknown
Source)
[junit] at
de.cenit.eb.sm.finca.functional.dblayer.events.internal.Osgi EventFromDatabaseService.activate(Unknown
Source)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
[junit] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:585)
[junit] at
org.eclipse.equinox.ds.instance.InvokeMethod.invokeMethod(In vokeMethod.java:144)
[junit] at
org.eclipse.equinox.ds.instance.InvokeMethod.activateCompone nt(InvokeMethod.java:60)
[junit] at
org.eclipse.equinox.ds.instance.BuildDispose.activate(BuildD ispose.java:672)
[junit] at
org.eclipse.equinox.ds.instance.BuildDispose.buildComponentC onfigInstance(BuildDispose.java:122)
[junit] at
org.eclipse.equinox.ds.instance.InstanceProcess.registerComp onentConfigurations(InstanceProcess.java:145)
[junit] at
org.eclipse.equinox.ds.resolver.Resolver.dispatchWork(Resolv er.java:701)
[junit] at
org.eclipse.equinox.ds.workqueue.WorkQueue$Queued.dispatch(W orkQueue.java:57)
[junit] at
org.eclipse.equinox.ds.workqueue.WorkQueue.run(WorkQueue.jav a:108)
[junit] Caused by: java.lang.ClassNotFoundException:
org.eclipse.persistence.internal.identitymaps.NoIdentityMap
[junit] at java.lang.ClassLoader.findClass(ClassLoader.java:358)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[junit] at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:429)
[junit] at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
[junit] at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
[junit] at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[junit] at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:289)
[junit] at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
[junit] at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1269)
[junit] at
org.eclipse.persistence.internal.jpa.deployment.osgi.BundleP roxyClassLoader.findClass(BundleProxyClassLoader.java:51)
[junit] at
org.eclipse.persistence.internal.jpa.deployment.osgi.BundleP roxyClassLoader.loadClass(BundleProxyClassLoader.java:59)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[junit] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
[junit] at java.lang.Class.forName0(Native Method)
[junit] at java.lang.Class.forName(Class.java:242)
[junit] at
org.eclipse.persistence.internal.security.PrivilegedAccessHe lper.getClassForName(PrivilegedAccessHelper.java:86)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. findClass(EntityManagerSetupImpl.java:522)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. findClassForProperty(EntityManagerSetupImpl.java:528)
[junit] ... 23 more
[junit] Local Exception Stack:
[junit] Exception [EclipseLink-28006] (Eclipse Persistence Services -
1.0.2 (Build 20081024)):
org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
[junit] Exception Description: ClassNotFound:
[org.eclipse.persistence.internal.identitymaps.NoIdentityMap ] specified in
[eclipselink.cache.type.default] property.
[junit] Internal Exception: java.lang.ClassNotFoundException:
org.eclipse.persistence.internal.identitymaps.NoIdentityMap
[junit] at
org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on.classNotFoundForProperty(EntityManagerSetupException.java :130)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. findClassForProperty(EntityManagerSetupImpl.java:532)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. updateDescriptorCacheSettings(EntityManagerSetupImpl.java:56 4)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. updateServerSession(EntityManagerSetupImpl.java:1194)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. deploy(EntityManagerSetupImpl.java:237)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.getServerSession(EntityManagerFactoryImpl.java:69)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.createEntityManagerImpl(EntityManagerFactoryImpl.java:118)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.createEntityManagerImpl(EntityManagerFactoryImpl.java:112)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.createEntityManager(EntityManagerFactoryImpl.java:100)
[junit] at
de.cenit.eb.sm.finca.functional.dblayer.events.internal.JpaU tils.createEntityManager(Unknown
Source)
[junit] at
de.cenit.eb.sm.finca.functional.dblayer.events.internal.JpaU tils.create(Unknown
Source)
[junit] at
de.cenit.eb.sm.finca.functional.dblayer.events.internal.Defa ultEvent2DatabaseService.activate(Unknown
Source)
[junit] at
de.cenit.eb.sm.finca.functional.dblayer.events.internal.Osgi Event2DatabaseService.activate(Unknown
Source)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
[junit] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:585)
[junit] at
org.eclipse.equinox.ds.instance.InvokeMethod.invokeMethod(In vokeMethod.java:144)
[junit] at
org.eclipse.equinox.ds.instance.InvokeMethod.activateCompone nt(InvokeMethod.java:60)
[junit] at
org.eclipse.equinox.ds.instance.BuildDispose.activate(BuildD ispose.java:672)
[junit] at
org.eclipse.equinox.ds.instance.BuildDispose.buildComponentC onfigInstance(BuildDispose.java:122)
[junit] at
org.eclipse.equinox.ds.instance.RegisterComponentService$2.g etService(RegisterComponentService.java:123)
[junit] at
org.eclipse.osgi.framework.internal.core.ServiceUse$1.run(Se rviceUse.java:108)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at
org.eclipse.osgi.framework.internal.core.ServiceUse.getServi ce(ServiceUse.java:106)
[junit] at
org.eclipse.osgi.framework.internal.core.ServiceRegistration Impl.getService(ServiceRegistrationImpl.java:345)
[junit] at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.g etService(BundleContextImpl.java:884)
[junit] at
org.eclipse.equinox.ds.instance.BuildDispose.getService(Buil dDispose.java:450)
[junit] at
org.eclipse.equinox.ds.instance.InvokeMethod.findBindOrUnbin dMethod(InvokeMethod.java:237)
[junit] at
org.eclipse.equinox.ds.instance.BuildDispose.bindServiceToRe ference(BuildDispose.java:387)
[junit] at
org.eclipse.equinox.ds.instance.BuildDispose.bindReference(B uildDispose.java:356)
[junit] at
org.eclipse.equinox.ds.instance.BuildDispose.bind(BuildDispo se.java:306)
[junit] at
org.eclipse.equinox.ds.instance.BuildDispose.buildComponentC onfigInstance(BuildDispose.java:120)
[junit] at
org.eclipse.equinox.ds.instance.InstanceProcess.registerComp onentConfigurations(InstanceProcess.java:145)
[junit] at
org.eclipse.equinox.ds.resolver.Resolver.dispatchWork(Resolv er.java:701)
[junit] at
org.eclipse.equinox.ds.workqueue.WorkQueue$Queued.dispatch(W orkQueue.java:57)
[junit] at
org.eclipse.equinox.ds.workqueue.WorkQueue.run(WorkQueue.jav a:108)
[junit] Caused by: java.lang.ClassNotFoundException:
org.eclipse.persistence.internal.identitymaps.NoIdentityMap
[junit] at java.lang.ClassLoader.findClass(ClassLoader.java:358)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[junit] at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:429)
[junit] at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
[junit] at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
[junit] at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[junit] at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:289)
[junit] at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
[junit] at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1269)
[junit] at
org.eclipse.persistence.internal.jpa.deployment.osgi.BundleP roxyClassLoader.findClass(BundleProxyClassLoader.java:51)
[junit] at
org.eclipse.persistence.internal.jpa.deployment.osgi.BundleP roxyClassLoader.loadClass(BundleProxyClassLoader.java:59)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[junit] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
[junit] at java.lang.Class.forName0(Native Method)
[junit] at java.lang.Class.forName(Class.java:242)
[junit] at
org.eclipse.persistence.internal.security.PrivilegedAccessHe lper.getClassForName(PrivilegedAccessHelper.java:86)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. findClass(EntityManagerSetupImpl.java:522)
[junit] at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. findClassForProperty(EntityManagerSetupImpl.java:528)
[junit] ... 35 more
...
Re: ClassNotFoundException when configuring caching in OSGi environment [message #385495 is a reply to message #385493] Mon, 23 February 2009 12:40 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Seems to be some kind of class loader issue with OSGI.

My guess is it is related to,

https://bugs.eclipse.org/bugs/show_bug.cgi?id=227330

But you may have your OSGI environment configured incorrectly as well.
Try one of the OSGI examples and see if you can recreate your issue.

---
James
http://www.nabble.com/EclipseLink---Users-f26658.html


James : Wiki : Book : Blog : Twitter
Re: ClassNotFoundException when configuring caching in OSGi environment [message #385742 is a reply to message #385495] Wed, 25 February 2009 14:24 Go to previous message
Joerg Matysiak is currently offline Joerg MatysiakFriend
Messages: 2
Registered: July 2009
Junior Member
Hi James,

thanks for your reply - it pointed me into the right direction.

Yes, it seems to be a classloader problem.

Adding an import for

org.eclipse.persistence.internal.identitymaps

to the MANIFEST.MF solves the problem.

However, this adds a fix dependency to the EclipseLink bundles
which is a little bit ugly, but currently no problem for me.

Thanks for help,
Jörg
Previous Topic:Alter Table & create Index
Next Topic:ObjectTypeConverter problems
Goto Forum:
  


Current Time: Thu Dec 18 13:32:56 GMT 2014

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

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