Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] JMX MBean and class loading issues
[Teneo] JMX MBean and class loading issues [message #125266] Fri, 06 June 2008 17:30 Go to next message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello!

I am using EMF for my domain models and use Teneo to store the model
instances to the database. My model has a Jobplan that contains 0 ... n
JobTasks. The code is generated with an EList as you know.

My problem: I am using JMX MBeans. There I have the operation "addTask".
This method shoud add the passed item to this Elist of the jobplan:
So far i have implemented it this way:
I am getting my default (EMF) Resource from my Persistence plugin and
querying with getContents the Jobplan instance. This works so far. But
when I want to access the EList of the Jobplan and then I get the
following exception:

06.06.2008 19:13:06 org.eclipse.emf.teneo.TeneoException <init>
SCHWERWIEGEND: Class not found:
org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
java.lang.ClassNotFoundException:
org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:124)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
at
org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.createPersistableList(EListPropertyHandler.java:38 8)
at
org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.set(EListPropertyHandler.java:337)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropert yValues(AbstractEntityTuplizer.java:337)
at
org.hibernate.persister.entity.AbstractEntityPersister.setPr opertyValues(AbstractEntityPersister.java:3566)
at
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:129)
at
org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:854)
at org.hibernate.loader.Loader.doQuery(Loader.java:729)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:236)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
at
org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:36)
at
org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:565)
at
org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:60)
at
org.eclipse.emf.teneo.hibernate.mapping.EMFInitializeCollect ionEventListener.onInitializeCollection(EMFInitializeCollect ionEventListener.java:61)
at
org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1716)
at
org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:344)
at
org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
at
org.hibernate.collection.PersistentList.toArray(PersistentLi st.java:123)
at
org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList.doLoad(HibernatePersistableEList.java:138)
at
org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(Pe rsistableEList.java:207)
at
org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:443)
at
org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:224)
at
at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:276)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
at
com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
at
javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
06.06.2008 19:13:06 org.eclipse.emf.teneo.TeneoException <init>
SCHWERWIEGEND: The field incoming can not be set using object
org.hibernate.collection.PersistentList on target
at.quorum.octopus.model.odm.impl.ScriptJobTaskImpl
org.eclipse.emf.teneo.extension.TeneoExtensionException: Class not found:
org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:147)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
at
org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.createPersistableList(EListPropertyHandler.java:38 8)
at
org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.set(EListPropertyHandler.java:337)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropert yValues(AbstractEntityTuplizer.java:337)
at
org.hibernate.persister.entity.AbstractEntityPersister.setPr opertyValues(AbstractEntityPersister.java:3566)
at
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:129)
at
org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:854)
at org.hibernate.loader.Loader.doQuery(Loader.java:729)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:236)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
at
org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:36)
at
org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:565)
at
org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:60)
at
org.eclipse.emf.teneo.hibernate.mapping.EMFInitializeCollect ionEventListener.onInitializeCollection(EMFInitializeCollect ionEventListener.java:61)
at
org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1716)
at
org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:344)
at
org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
at
org.hibernate.collection.PersistentList.toArray(PersistentLi st.java:123)
at
org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList.doLoad(HibernatePersistableEList.java:138)
at
org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(Pe rsistableEList.java:207)
at
org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:443)
at
org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:224)
at
at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:276)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
at
com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
at
javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException:
org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:124)
... 53 more


Ok, it seems to me that this problem is bounded to OSGi and class loading
issues. But why cannot he load the hibernate EList ?!?
The JMX plug-in depends on my "Persistence" plug-in like all other
plug-ins that need to store things to database. In every other plug-in
this works but not in my JMX plug-in?! Does the JMX code run in a special
"thread"?!?

My Bean is a standard model bean which implements a YXZMBean and extends
from the StandardEmitterMBean. I am using JDK 1.6.

How can I solve my problem?!? Is there any work around?!?

Please help me!!!

Best regards,
Matthias
Re: [Teneo] JMX MBean and class loading issues [message #125304 is a reply to message #125266] Fri, 06 June 2008 20:28 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Matthias,
It seems that the org.eclipse.emf.teneo plugin can't see the classes from the
org.eclipse.emf.teneo.hibernate plugin. What type of environment are you running (which osgi server,
web server, app server?)?

If run within an osgi environment: the org.eclipse.emf.teneo plugin depends on a specific Eclipse
property (Eclipse-Buddypolicy) which (afaik) is not supported by other osgi environments. So then
the issue you post can occur.

gr. Martin

Matthias wrote:
> Hello!
>
> I am using EMF for my domain models and use Teneo to store the model
> instances to the database. My model has a Jobplan that contains 0 ... n
> JobTasks. The code is generated with an EList as you know.
>
> My problem: I am using JMX MBeans. There I have the operation "addTask".
> This method shoud add the passed item to this Elist of the jobplan:
> So far i have implemented it this way:
> I am getting my default (EMF) Resource from my Persistence plugin and
> querying with getContents the Jobplan instance. This works so far. But
> when I want to access the EList of the Jobplan and then I get the
> following exception:
>
> 06.06.2008 19:13:06 org.eclipse.emf.teneo.TeneoException <init>
> SCHWERWIEGEND: Class not found:
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
> java.lang.ClassNotFoundException:
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:124)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.createPersistableList(EListPropertyHandler.java:38 8)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.set(EListPropertyHandler.java:337)
>
> at
> org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropert yValues(AbstractEntityTuplizer.java:337)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.setPr opertyValues(AbstractEntityPersister.java:3566)
>
> at
> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:129)
> at
> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:854)
>
> at org.hibernate.loader.Loader.doQuery(Loader.java:729)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:236)
>
> at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
> at
> org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:36)
>
> at
> org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:565)
>
> at
> org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:60)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.EMFInitializeCollect ionEventListener.onInitializeCollection(EMFInitializeCollect ionEventListener.java:61)
>
> at
> org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1716)
> at
> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:344)
>
> at
> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>
> at
> org.hibernate.collection.PersistentList.toArray(PersistentLi st.java:123)
> at
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList.doLoad(HibernatePersistableEList.java:138)
>
> at
> org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(Pe rsistableEList.java:207)
>
> at
> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:443)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:224)
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:276)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
> 06.06.2008 19:13:06 org.eclipse.emf.teneo.TeneoException <init>
> SCHWERWIEGEND: The field incoming can not be set using object
> org.hibernate.collection.PersistentList on target
> at.quorum.octopus.model.odm.impl.ScriptJobTaskImpl
> org.eclipse.emf.teneo.extension.TeneoExtensionException: Class not
> found:
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:147)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.createPersistableList(EListPropertyHandler.java:38 8)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.set(EListPropertyHandler.java:337)
>
> at
> org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropert yValues(AbstractEntityTuplizer.java:337)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.setPr opertyValues(AbstractEntityPersister.java:3566)
>
> at
> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:129)
> at
> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:854)
>
> at org.hibernate.loader.Loader.doQuery(Loader.java:729)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:236)
>
> at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
> at
> org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:36)
>
> at
> org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:565)
>
> at
> org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:60)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.EMFInitializeCollect ionEventListener.onInitializeCollection(EMFInitializeCollect ionEventListener.java:61)
>
> at
> org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1716)
> at
> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:344)
>
> at
> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>
> at
> org.hibernate.collection.PersistentList.toArray(PersistentLi st.java:123)
> at
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList.doLoad(HibernatePersistableEList.java:138)
>
> at
> org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(Pe rsistableEList.java:207)
>
> at
> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:443)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:224)
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:276)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:124)
>
> ... 53 more
>
>
> Ok, it seems to me that this problem is bounded to OSGi and class
> loading issues. But why cannot he load the hibernate EList ?!?
> The JMX plug-in depends on my "Persistence" plug-in like all other
> plug-ins that need to store things to database. In every other plug-in
> this works but not in my JMX plug-in?! Does the JMX code run in a
> special "thread"?!?
> My Bean is a standard model bean which implements a YXZMBean and extends
> from the StandardEmitterMBean. I am using JDK 1.6.
>
> How can I solve my problem?!? Is there any work around?!?
>
> Please help me!!!
>
> Best regards,
> Matthias
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] JMX MBean and class loading issues [message #125328 is a reply to message #125304] Fri, 06 June 2008 22:00 Go to previous messageGo to next message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello Martin!

Thank you for your answer and for the interest in my problem!

I am executing the server as a Eclipse application, and all bundles
(plugins) are loaded at startup.
The funny thing is, if I copy the code to another plugin everything works
as wanted, even when I execute the code in the Activator class of the JMX
plug-in. So something is different when code is invoked inside a JMX
MBean. But what?!? Has it something todo with RMI?!? Is this OSGi /
Equinox related?!?

As you know I have a "Persistence" plugin that offers a "DB Storage"
service. When this service is *firstly* invoked from the JMX plugin within
a JMX bean than I get the following exception:

06.06.2008 23:53:51 org.eclipse.emf.teneo.classloader.ClassLoaderResolver
setClassLoaderStrategy
INFO: Class loader strategy set to:
org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
06.06.2008 23:53:51 org.eclipse.emf.teneo.TeneoException <init>
SCHWERWIEGEND: Class for name exception
java.lang.ClassNotFoundException:
org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classF orName(ClassLoaderResolver.java:51)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:133)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
at
at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
at
at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
at
at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
at
at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:89)
at at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:67)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at
at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:271)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
at
com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
at
javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)


Maybe you know now how to solve the problem!
Am I really the first one who wants to have JMX Mbeans with EMF/Teneo
technology?!?

Thank you for any information!

Best regards,
Matthias
Re: [Teneo] JMX MBean and class loading issues [message #125395 is a reply to message #125328] Fri, 06 June 2008 23:21 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Matthias,
I can now see that it goes wrong when loading a classloader. To load the classloader Teneo uses the
org.eclipse.emf.teneo.classloader.ClassLoaderResolver class. This class has a static member
(ClassLoaderStrategy) which you can set as the default classloader. As a default the
ContextClassloader is used (which does Thread.currentThread().getContextClassLoader() to find the
classloader). Normally this works fine.
What I can see is that the last part of the stacktrace does not use the osgi classloader but the
default sun classloader. This is where the issue(s) are coming from.

Can you debug into the org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classF orName method and
then check which classloader is used?

gr. Martin

Matthias wrote:
> Hello Martin!
>
> Thank you for your answer and for the interest in my problem!
>
> I am executing the server as a Eclipse application, and all bundles
> (plugins) are loaded at startup.
> The funny thing is, if I copy the code to another plugin everything
> works as wanted, even when I execute the code in the Activator class of
> the JMX plug-in. So something is different when code is invoked inside a
> JMX MBean. But what?!? Has it something todo with RMI?!? Is this OSGi /
> Equinox related?!?
>
> As you know I have a "Persistence" plugin that offers a "DB Storage"
> service. When this service is *firstly* invoked from the JMX plugin
> within a JMX bean than I get the following exception:
>
> 06.06.2008 23:53:51
> org.eclipse.emf.teneo.classloader.ClassLoaderResolver
> setClassLoaderStrategy
> INFO: Class loader strategy set to:
> org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
> 06.06.2008 23:53:51 org.eclipse.emf.teneo.TeneoException <init>
> SCHWERWIEGEND: Class for name exception
> java.lang.ClassNotFoundException:
> org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at
> org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classF orName(ClassLoaderResolver.java:51)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:133)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
>
> at
> at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:89)
> at
> at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:67)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
>
> at
> org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
>
> at
> org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:271)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.


PoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
>
>
> Maybe you know now how to solve the problem! Am I really the first one
> who wants to have JMX Mbeans with EMF/Teneo technology?!?
>
> Thank you for any information!
>
> Best regards,
> Matthias
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] JMX MBean and class loading issues [message #125421 is a reply to message #125395] Sat, 07 June 2008 11:24 Go to previous messageGo to next message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Martin Taal wrote:

> Hi Matthias,
> I can now see that it goes wrong when loading a classloader. To load the
classloader Teneo uses the
> org.eclipse.emf.teneo.classloader.ClassLoaderResolver class. This class has
a static member
> (ClassLoaderStrategy) which you can set as the default classloader. As a
default the
> ContextClassloader is used (which does
Thread.currentThread().getContextClassLoader() to find the
> classloader). Normally this works fine.
> What I can see is that the last part of the stacktrace does not use the osgi
classloader but the
> default sun classloader. This is where the issue(s) are coming from.

> Can you debug into the
org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classF orName method and
> then check which classloader is used?

> gr. Martin



Hello Martin!

Yes you are right its definitly a class loader issue.

When accessing my model instances from any other plug-in than the JMX
MBeans the org.eclipse.core.runtime.internal.adaptor.ContextFinder gets
returned from the current Thread
(Thread.currentThread.getContextClassLoader() ). But if I access the model
or other EMF/Teneo specific objects then the current Thread (MBean)
returns sun.misc.Launcher$AppClassLoader. And so I think this Class loader
cannot find the Teneo classes! Must we use the Context class loader
always?!? Can we access the ContextFinder classloader from the code?!

Can we handle this issue with the Teneo classloading implementation or is
this problem only solvable on the JMX side?!?

Thank you!

Best Reagrds,
Matthias
Re: [Teneo] JMX MBean and class loading issues [message #125435 is a reply to message #125421] Sat, 07 June 2008 12:55 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Matthias,
In the basis Teneo uses the classloader set in the ClassLoaderResolver class. You can see the
setClassLoaderStrategy method there which you can use to set a ClassLoaderStrategy. There are
currently two strategies available: ClassClassloaderStrategy, ContextClassLoaderStrategy (the default).
You can try to set the ClassClassLoaderStrategy to see if it makes a difference.

Can you check which classloaderstrategy is being used currently? Just set a breakpoint in
ClassLoaderResolver.getClassLoaderStrategy. Then I think the best approach is to research what are
the available classloaders for the class and thread, and see which in the end uses the osgi class
loader (each classloader has a parent classloader).

So it is a bit of trial and error but this should be solvable.

gr. Martin

Matthias wrote:
> Martin Taal wrote:
>
>> Hi Matthias,
>> I can now see that it goes wrong when loading a classloader. To load the Yes,
> classloader Teneo uses the
>> org.eclipse.emf.teneo.classloader.ClassLoaderResolver class. This
>> class has
> a static member
>> (ClassLoaderStrategy) which you can set as the default classloader. As a
> default the
>> ContextClassloader is used (which does
> Thread.currentThread().getContextClassLoader() to find the
>> classloader). Normally this works fine.
>> What I can see is that the last part of the stacktrace does not use
>> the osgi
> classloader but the
>> default sun classloader. This is where the issue(s) are coming from.
>
>> Can you debug into the
> org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classF orName
> method and
>> then check which classloader is used?
>
>> gr. Martin
>
>
>
> Hello Martin!
>
> Yes you are right its definitly a class loader issue.
>
> When accessing my model instances from any other plug-in than the JMX
> MBeans the org.eclipse.core.runtime.internal.adaptor.ContextFinder gets
> returned from the current Thread
> (Thread.currentThread.getContextClassLoader() ). But if I access the
> model or other EMF/Teneo specific objects then the current Thread
> (MBean) returns sun.misc.Launcher$AppClassLoader. And so I think this
> Class loader cannot find the Teneo classes! Must we use the Context
> class loader always?!? Can we access the ContextFinder classloader from
> the code?!
>
> Can we handle this issue with the Teneo classloading implementation or
> is this problem only solvable on the JMX side?!?
>
> Thank you!
>
> Best Reagrds,
> Matthias
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] JMX MBean and class loading issues [message #125449 is a reply to message #125435] Sat, 07 June 2008 14:19 Go to previous messageGo to next message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello Martin!

Thank you for your help! I have changed the static initialized in the
ClassLoaderResolver class to use ClassClassLoaderStrategy (Log: "Class
loader strategy set to:
org.eclipse.emf.teneo.classloader.ClassClassLoaderStrategy"), but it does
not help.

Then I have set a brackpoint to classForName(), getClassLoader() and
getClassLoaderStrategy(). Firstly classForName with argument
" org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy " gets
called. Then he calls getClassLoader() which returns a
"org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader" object. The
getClassLoaderStrategy() does not get called.

When i change the classloaderStrategy to ContextClassLoaderStrategy then
getClassLoader() returns "sun.misc.Launcher$AppClassLoader" which is I
assume completly wrong. So changing the strategy to
"ClassClassLoaderStrategy" may already help but still this exception when
I do so:

07.06.2008 16:02:39 org.eclipse.emf.teneo.TeneoException <init>
SCHWERWIEGEND: Class not found: org.eclipse.emf.teneo.PersistenceOptions
java.lang.ClassNotFoundException: org.eclipse.emf.teneo.PersistenceOptions
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
at
at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
at
at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
at
at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
at
at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
at at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at
at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
at
com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
at
javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)



org.osgi.framework.BundleException: Exception in
at.quorum.octopus.io.OctopusCorePlugin.start() of bundle
at.quorum.octopus.io.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1028)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at
at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
at
com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
at
javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.eclipse.emf.teneo.extension.TeneoExtensionException: Class
not found: org.eclipse.emf.teneo.PersistenceOptions
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:147)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
at
at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
at
at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
at
at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
at
at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
at at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
... 47 more
Caused by: java.lang.ClassNotFoundException:
org.eclipse.emf.teneo.PersistenceOptions
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
... 57 more
Root exception:
org.eclipse.emf.teneo.extension.TeneoExtensionException: Class not found:
org.eclipse.emf.teneo.PersistenceOptions
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:147)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
at
at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
at
at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
at
at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
at
at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
at at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at
at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
at
com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
at
javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException:
org.eclipse.emf.teneo.PersistenceOptions
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
... 57 more


I hope I have provided you with enogh information! Thank you for your
answers!

Best regards,
Matthias
Re: [Teneo] JMX MBean and class loading issues [message #125462 is a reply to message #125449] Sat, 07 June 2008 20:43 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Matthias,
I am still not sure why the ContextClassLoaderStrategy does not work. After setting the
ClassLoaderStrategy to ClassClassLoaderStrategy then before calling dataStore.setProperties(...) set
the extensionmanager to also use this classloader:
dataStore.getExtensionManager().registerExtension(createExte nsion(ClassLoaderStrategy.class,
ContextClassLoaderStrategy.class));

Let me know if this helps.

gr. Martin

Matthias wrote:
> Hello Martin!
>
> Thank you for your help! I have changed the static initialized in the
> ClassLoaderResolver class to use ClassClassLoaderStrategy (Log: "Class
> loader strategy set to:
> org.eclipse.emf.teneo.classloader.ClassClassLoaderStrategy"), but it
> does not help.
> Then I have set a brackpoint to classForName(), getClassLoader() and
> getClassLoaderStrategy(). Firstly classForName with argument
> " org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy " gets
> called. Then he calls getClassLoader() which returns a
> "org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader" object. The
> getClassLoaderStrategy() does not get called.
>
> When i change the classloaderStrategy to ContextClassLoaderStrategy then
> getClassLoader() returns "sun.misc.Launcher$AppClassLoader" which is I
> assume completly wrong. So changing the strategy to
> "ClassClassLoaderStrategy" may already help but still this exception
> when I do so:
>
> 07.06.2008 16:02:39 org.eclipse.emf.teneo.TeneoException <init>
> SCHWERWIEGEND: Class not found: org.eclipse.emf.teneo.PersistenceOptions
> java.lang.ClassNotFoundException: org.eclipse.emf.teneo.PersistenceOptions
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
>
> at
> at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
> at
> at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
>
> at
> org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
>
> at
> org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
>
>
>
> org.osgi.framework.BundleException: Exception in
> at.quorum.octopus.io.OctopusCorePlugin.start() of bundle
> at.quorum.octopus.io.
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1028)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
>
> at
> org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
>
> at
> org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
> Caused by: org.eclipse.emf.teneo.extension.TeneoExtensionException:
> Class not found: org.eclipse.emf.teneo.PersistenceOptions
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:147)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
>
> at
> at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
> at
> at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
>
> ... 47 more
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.emf.teneo.PersistenceOptions
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
>
> ... 57 more
> Root exception:
> org.eclipse.emf.teneo.extension.TeneoExtensionException: Class not
> found: org.eclipse.emf.teneo.PersistenceOptions
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:147)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
>
> at
> at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
> at
> at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
>
> at
> org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
>
> at
> org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.emf.teneo.PersistenceOptions
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
>
> ... 57 more
>
>
> I hope I have provided you with enogh information! Thank you for your
> answers!
>
> Best regards,
> Matthias
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] JMX MBean and class loading issues [message #125516 is a reply to message #125462] Mon, 09 June 2008 05:19 Go to previous messageGo to next message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello Martin,

Thank you for your help! Finally, it works ;) !!!!
As you suggested, I have set the ClassLoaderStrategy in the
ClassLoaderResolver class to "setClassLoaderStrategy(new
ClassClassLoaderStrategy());" in the static initializer.

Then I have added this code to my data store initialization part:
"localDataStore.getExtensionManager().registerExtension(
ClassLoaderStrategy.class.getName(),
ClassClassLoaderStrategy.class.getName());"

All my other plug-ins are working so far with this changes. But is there a
"cleaner" way to set the ClassLoaderStrategy without changing the
org.eclipse.emf.teneo plug-in?!? Why is not the ClassClassLoaderStrategy
the default one used?!? Is there a "bug" in Teneo?!?

Again, thank you for your help!

Matthias!
Re: [Teneo] JMX MBean and class loading issues [message #125602 is a reply to message #125516] Tue, 10 June 2008 13:07 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Matthias,
Good that it works, classloading issues are always very annoying.

Regarding this, afaics no there is no 'bug' in Teneo. I am not sure either if this can be tagged as
'changing the teneo plugin'. It is just setting an option just as also setting the database driver etc.
Maybe the strange thing with the classloader compared to other extensions is that you both have to
set the ClassLoaderStrategy in the ClassLoaderResolver. This can be made simpler I think to always
use the one defined in the ClassLoaderResolver. I will look at that.

My idea was/is that the context class loader (which uses the thread classloader) is a good default.

gr. Martin


Matthias wrote:
> Hello Martin,
>
> Thank you for your help! Finally, it works ;) !!!!
> As you suggested, I have set the ClassLoaderStrategy in the
> ClassLoaderResolver class to "setClassLoaderStrategy(new
> ClassClassLoaderStrategy());" in the static initializer.
>
> Then I have added this code to my data store initialization part:
> "localDataStore.getExtensionManager().registerExtension(
> ClassLoaderStrategy.class.getName(),
> ClassClassLoaderStrategy.class.getName());"
>
> All my other plug-ins are working so far with this changes. But is there
> a "cleaner" way to set the ClassLoaderStrategy without changing the
> org.eclipse.emf.teneo plug-in?!? Why is not the ClassClassLoaderStrategy
> the default one used?!? Is there a "bug" in Teneo?!?
>
> Again, thank you for your help!
>
> Matthias!
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] JMX MBean and class loading issues [message #619205 is a reply to message #125266] Fri, 06 June 2008 20:28 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Matthias,
It seems that the org.eclipse.emf.teneo plugin can't see the classes from the
org.eclipse.emf.teneo.hibernate plugin. What type of environment are you running (which osgi server,
web server, app server?)?

If run within an osgi environment: the org.eclipse.emf.teneo plugin depends on a specific Eclipse
property (Eclipse-Buddypolicy) which (afaik) is not supported by other osgi environments. So then
the issue you post can occur.

gr. Martin

Matthias wrote:
> Hello!
>
> I am using EMF for my domain models and use Teneo to store the model
> instances to the database. My model has a Jobplan that contains 0 ... n
> JobTasks. The code is generated with an EList as you know.
>
> My problem: I am using JMX MBeans. There I have the operation "addTask".
> This method shoud add the passed item to this Elist of the jobplan:
> So far i have implemented it this way:
> I am getting my default (EMF) Resource from my Persistence plugin and
> querying with getContents the Jobplan instance. This works so far. But
> when I want to access the EList of the Jobplan and then I get the
> following exception:
>
> 06.06.2008 19:13:06 org.eclipse.emf.teneo.TeneoException <init>
> SCHWERWIEGEND: Class not found:
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
> java.lang.ClassNotFoundException:
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:124)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.createPersistableList(EListPropertyHandler.java:38 8)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.set(EListPropertyHandler.java:337)
>
> at
> org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropert yValues(AbstractEntityTuplizer.java:337)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.setPr opertyValues(AbstractEntityPersister.java:3566)
>
> at
> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:129)
> at
> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:854)
>
> at org.hibernate.loader.Loader.doQuery(Loader.java:729)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:236)
>
> at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
> at
> org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:36)
>
> at
> org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:565)
>
> at
> org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:60)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.EMFInitializeCollect ionEventListener.onInitializeCollection(EMFInitializeCollect ionEventListener.java:61)
>
> at
> org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1716)
> at
> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:344)
>
> at
> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>
> at
> org.hibernate.collection.PersistentList.toArray(PersistentLi st.java:123)
> at
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList.doLoad(HibernatePersistableEList.java:138)
>
> at
> org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(Pe rsistableEList.java:207)
>
> at
> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:443)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:224)
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:276)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
> 06.06.2008 19:13:06 org.eclipse.emf.teneo.TeneoException <init>
> SCHWERWIEGEND: The field incoming can not be set using object
> org.hibernate.collection.PersistentList on target
> at.quorum.octopus.model.odm.impl.ScriptJobTaskImpl
> org.eclipse.emf.teneo.extension.TeneoExtensionException: Class not
> found:
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:147)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.createPersistableList(EListPropertyHandler.java:38 8)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.property.EListProper tyHandler.set(EListPropertyHandler.java:337)
>
> at
> org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropert yValues(AbstractEntityTuplizer.java:337)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.setPr opertyValues(AbstractEntityPersister.java:3566)
>
> at
> org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseL oad.java:129)
> at
> org.hibernate.loader.Loader.initializeEntitiesAndCollections (Loader.java:854)
>
> at org.hibernate.loader.Loader.doQuery(Loader.java:729)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyColle ctions(Loader.java:236)
>
> at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
> at
> org.hibernate.loader.collection.CollectionLoader.initialize( CollectionLoader.java:36)
>
> at
> org.hibernate.persister.collection.AbstractCollectionPersist er.initialize(AbstractCollectionPersister.java:565)
>
> at
> org.hibernate.event.def.DefaultInitializeCollectionEventList ener.onInitializeCollection(DefaultInitializeCollectionEvent Listener.java:60)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.EMFInitializeCollect ionEventListener.onInitializeCollection(EMFInitializeCollect ionEventListener.java:61)
>
> at
> org.hibernate.impl.SessionImpl.initializeCollection(SessionI mpl.java:1716)
> at
> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:344)
>
> at
> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>
> at
> org.hibernate.collection.PersistentList.toArray(PersistentLi st.java:123)
> at
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList.doLoad(HibernatePersistableEList.java:138)
>
> at
> org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(Pe rsistableEList.java:207)
>
> at
> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:443)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:224)
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:276)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersi stableEList
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:124)
>
> ... 53 more
>
>
> Ok, it seems to me that this problem is bounded to OSGi and class
> loading issues. But why cannot he load the hibernate EList ?!?
> The JMX plug-in depends on my "Persistence" plug-in like all other
> plug-ins that need to store things to database. In every other plug-in
> this works but not in my JMX plug-in?! Does the JMX code run in a
> special "thread"?!?
> My Bean is a standard model bean which implements a YXZMBean and extends
> from the StandardEmitterMBean. I am using JDK 1.6.
>
> How can I solve my problem?!? Is there any work around?!?
>
> Please help me!!!
>
> Best regards,
> Matthias
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] JMX MBean and class loading issues [message #619207 is a reply to message #125304] Fri, 06 June 2008 22:00 Go to previous message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello Martin!

Thank you for your answer and for the interest in my problem!

I am executing the server as a Eclipse application, and all bundles
(plugins) are loaded at startup.
The funny thing is, if I copy the code to another plugin everything works
as wanted, even when I execute the code in the Activator class of the JMX
plug-in. So something is different when code is invoked inside a JMX
MBean. But what?!? Has it something todo with RMI?!? Is this OSGi /
Equinox related?!?

As you know I have a "Persistence" plugin that offers a "DB Storage"
service. When this service is *firstly* invoked from the JMX plugin within
a JMX bean than I get the following exception:

06.06.2008 23:53:51 org.eclipse.emf.teneo.classloader.ClassLoaderResolver
setClassLoaderStrategy
INFO: Class loader strategy set to:
org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
06.06.2008 23:53:51 org.eclipse.emf.teneo.TeneoException <init>
SCHWERWIEGEND: Class for name exception
java.lang.ClassNotFoundException:
org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classF orName(ClassLoaderResolver.java:51)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:133)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
at
at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
at
at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
at
at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
at
at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:89)
at at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:67)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at
at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:271)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
at
com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
at
javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)


Maybe you know now how to solve the problem!
Am I really the first one who wants to have JMX Mbeans with EMF/Teneo
technology?!?

Thank you for any information!

Best regards,
Matthias
Re: [Teneo] JMX MBean and class loading issues [message #619212 is a reply to message #125328] Fri, 06 June 2008 23:21 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Matthias,
I can now see that it goes wrong when loading a classloader. To load the classloader Teneo uses the
org.eclipse.emf.teneo.classloader.ClassLoaderResolver class. This class has a static member
(ClassLoaderStrategy) which you can set as the default classloader. As a default the
ContextClassloader is used (which does Thread.currentThread().getContextClassLoader() to find the
classloader). Normally this works fine.
What I can see is that the last part of the stacktrace does not use the osgi classloader but the
default sun classloader. This is where the issue(s) are coming from.

Can you debug into the org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classF orName method and
then check which classloader is used?

gr. Martin

Matthias wrote:
> Hello Martin!
>
> Thank you for your answer and for the interest in my problem!
>
> I am executing the server as a Eclipse application, and all bundles
> (plugins) are loaded at startup.
> The funny thing is, if I copy the code to another plugin everything
> works as wanted, even when I execute the code in the Activator class of
> the JMX plug-in. So something is different when code is invoked inside a
> JMX MBean. But what?!? Has it something todo with RMI?!? Is this OSGi /
> Equinox related?!?
>
> As you know I have a "Persistence" plugin that offers a "DB Storage"
> service. When this service is *firstly* invoked from the JMX plugin
> within a JMX bean than I get the following exception:
>
> 06.06.2008 23:53:51
> org.eclipse.emf.teneo.classloader.ClassLoaderResolver
> setClassLoaderStrategy
> INFO: Class loader strategy set to:
> org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
> 06.06.2008 23:53:51 org.eclipse.emf.teneo.TeneoException <init>
> SCHWERWIEGEND: Class for name exception
> java.lang.ClassNotFoundException:
> org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at
> org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classF orName(ClassLoaderResolver.java:51)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:133)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
>
> at
> at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:89)
> at
> at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:67)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
>
> at
> org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
>
> at
> org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:271)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.


PoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
>
>
> Maybe you know now how to solve the problem! Am I really the first one
> who wants to have JMX Mbeans with EMF/Teneo technology?!?
>
> Thank you for any information!
>
> Best regards,
> Matthias
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] JMX MBean and class loading issues [message #619214 is a reply to message #125395] Sat, 07 June 2008 11:24 Go to previous message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Martin Taal wrote:

> Hi Matthias,
> I can now see that it goes wrong when loading a classloader. To load the
classloader Teneo uses the
> org.eclipse.emf.teneo.classloader.ClassLoaderResolver class. This class has
a static member
> (ClassLoaderStrategy) which you can set as the default classloader. As a
default the
> ContextClassloader is used (which does
Thread.currentThread().getContextClassLoader() to find the
> classloader). Normally this works fine.
> What I can see is that the last part of the stacktrace does not use the osgi
classloader but the
> default sun classloader. This is where the issue(s) are coming from.

> Can you debug into the
org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classF orName method and
> then check which classloader is used?

> gr. Martin



Hello Martin!

Yes you are right its definitly a class loader issue.

When accessing my model instances from any other plug-in than the JMX
MBeans the org.eclipse.core.runtime.internal.adaptor.ContextFinder gets
returned from the current Thread
(Thread.currentThread.getContextClassLoader() ). But if I access the model
or other EMF/Teneo specific objects then the current Thread (MBean)
returns sun.misc.Launcher$AppClassLoader. And so I think this Class loader
cannot find the Teneo classes! Must we use the Context class loader
always?!? Can we access the ContextFinder classloader from the code?!

Can we handle this issue with the Teneo classloading implementation or is
this problem only solvable on the JMX side?!?

Thank you!

Best Reagrds,
Matthias
Re: [Teneo] JMX MBean and class loading issues [message #619215 is a reply to message #125421] Sat, 07 June 2008 12:55 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Matthias,
In the basis Teneo uses the classloader set in the ClassLoaderResolver class. You can see the
setClassLoaderStrategy method there which you can use to set a ClassLoaderStrategy. There are
currently two strategies available: ClassClassloaderStrategy, ContextClassLoaderStrategy (the default).
You can try to set the ClassClassLoaderStrategy to see if it makes a difference.

Can you check which classloaderstrategy is being used currently? Just set a breakpoint in
ClassLoaderResolver.getClassLoaderStrategy. Then I think the best approach is to research what are
the available classloaders for the class and thread, and see which in the end uses the osgi class
loader (each classloader has a parent classloader).

So it is a bit of trial and error but this should be solvable.

gr. Martin

Matthias wrote:
> Martin Taal wrote:
>
>> Hi Matthias,
>> I can now see that it goes wrong when loading a classloader. To load the Yes,
> classloader Teneo uses the
>> org.eclipse.emf.teneo.classloader.ClassLoaderResolver class. This
>> class has
> a static member
>> (ClassLoaderStrategy) which you can set as the default classloader. As a
> default the
>> ContextClassloader is used (which does
> Thread.currentThread().getContextClassLoader() to find the
>> classloader). Normally this works fine.
>> What I can see is that the last part of the stacktrace does not use
>> the osgi
> classloader but the
>> default sun classloader. This is where the issue(s) are coming from.
>
>> Can you debug into the
> org.eclipse.emf.teneo.classloader.ClassLoaderResolver.classF orName
> method and
>> then check which classloader is used?
>
>> gr. Martin
>
>
>
> Hello Martin!
>
> Yes you are right its definitly a class loader issue.
>
> When accessing my model instances from any other plug-in than the JMX
> MBeans the org.eclipse.core.runtime.internal.adaptor.ContextFinder gets
> returned from the current Thread
> (Thread.currentThread.getContextClassLoader() ). But if I access the
> model or other EMF/Teneo specific objects then the current Thread
> (MBean) returns sun.misc.Launcher$AppClassLoader. And so I think this
> Class loader cannot find the Teneo classes! Must we use the Context
> class loader always?!? Can we access the ContextFinder classloader from
> the code?!
>
> Can we handle this issue with the Teneo classloading implementation or
> is this problem only solvable on the JMX side?!?
>
> Thank you!
>
> Best Reagrds,
> Matthias
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] JMX MBean and class loading issues [message #619216 is a reply to message #125435] Sat, 07 June 2008 14:19 Go to previous message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello Martin!

Thank you for your help! I have changed the static initialized in the
ClassLoaderResolver class to use ClassClassLoaderStrategy (Log: "Class
loader strategy set to:
org.eclipse.emf.teneo.classloader.ClassClassLoaderStrategy"), but it does
not help.

Then I have set a brackpoint to classForName(), getClassLoader() and
getClassLoaderStrategy(). Firstly classForName with argument
" org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy " gets
called. Then he calls getClassLoader() which returns a
"org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader" object. The
getClassLoaderStrategy() does not get called.

When i change the classloaderStrategy to ContextClassLoaderStrategy then
getClassLoader() returns "sun.misc.Launcher$AppClassLoader" which is I
assume completly wrong. So changing the strategy to
"ClassClassLoaderStrategy" may already help but still this exception when
I do so:

07.06.2008 16:02:39 org.eclipse.emf.teneo.TeneoException <init>
SCHWERWIEGEND: Class not found: org.eclipse.emf.teneo.PersistenceOptions
java.lang.ClassNotFoundException: org.eclipse.emf.teneo.PersistenceOptions
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
at
at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
at
at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
at
at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
at
at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
at at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at
at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
at
com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
at
javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)



org.osgi.framework.BundleException: Exception in
at.quorum.octopus.io.OctopusCorePlugin.start() of bundle
at.quorum.octopus.io.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1028)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at
at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
at
com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
at
javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.eclipse.emf.teneo.extension.TeneoExtensionException: Class
not found: org.eclipse.emf.teneo.PersistenceOptions
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:147)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
at
at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
at
at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
at
at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
at
at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
at at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
... 47 more
Caused by: java.lang.ClassNotFoundException:
org.eclipse.emf.teneo.PersistenceOptions
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
... 57 more
Root exception:
org.eclipse.emf.teneo.extension.TeneoExtensionException: Class not found:
org.eclipse.emf.teneo.PersistenceOptions
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:147)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
at
at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
at
at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
at
at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
at
at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
at at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at
at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
at
com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
at
com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
at
javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException:
org.eclipse.emf.teneo.PersistenceOptions
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
... 57 more


I hope I have provided you with enogh information! Thank you for your
answers!

Best regards,
Matthias
Re: [Teneo] JMX MBean and class loading issues [message #619217 is a reply to message #125449] Sat, 07 June 2008 20:43 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Matthias,
I am still not sure why the ContextClassLoaderStrategy does not work. After setting the
ClassLoaderStrategy to ClassClassLoaderStrategy then before calling dataStore.setProperties(...) set
the extensionmanager to also use this classloader:
dataStore.getExtensionManager().registerExtension(createExte nsion(ClassLoaderStrategy.class,
ContextClassLoaderStrategy.class));

Let me know if this helps.

gr. Martin

Matthias wrote:
> Hello Martin!
>
> Thank you for your help! I have changed the static initialized in the
> ClassLoaderResolver class to use ClassClassLoaderStrategy (Log: "Class
> loader strategy set to:
> org.eclipse.emf.teneo.classloader.ClassClassLoaderStrategy"), but it
> does not help.
> Then I have set a brackpoint to classForName(), getClassLoader() and
> getClassLoaderStrategy(). Firstly classForName with argument
> " org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy " gets
> called. Then he calls getClassLoader() which returns a
> "org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader" object. The
> getClassLoaderStrategy() does not get called.
>
> When i change the classloaderStrategy to ContextClassLoaderStrategy then
> getClassLoader() returns "sun.misc.Launcher$AppClassLoader" which is I
> assume completly wrong. So changing the strategy to
> "ClassClassLoaderStrategy" may already help but still this exception
> when I do so:
>
> 07.06.2008 16:02:39 org.eclipse.emf.teneo.TeneoException <init>
> SCHWERWIEGEND: Class not found: org.eclipse.emf.teneo.PersistenceOptions
> java.lang.ClassNotFoundException: org.eclipse.emf.teneo.PersistenceOptions
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
>
> at
> at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
> at
> at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
>
> at
> org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
>
> at
> org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
>
>
>
> org.osgi.framework.BundleException: Exception in
> at.quorum.octopus.io.OctopusCorePlugin.start() of bundle
> at.quorum.octopus.io.
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1028)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
>
> at
> org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
>
> at
> org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
> Caused by: org.eclipse.emf.teneo.extension.TeneoExtensionException:
> Class not found: org.eclipse.emf.teneo.PersistenceOptions
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:147)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
>
> at
> at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
> at
> at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
>
> ... 47 more
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.emf.teneo.PersistenceOptions
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
>
> ... 57 more
> Root exception:
> org.eclipse.emf.teneo.extension.TeneoExtensionException: Class not
> found: org.eclipse.emf.teneo.PersistenceOptions
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:147)
>
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:273)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.setProperties(Hb DataStore.java:316)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.initializeDa taStore(DBStoreProvider.java:142)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.getDataStore (DBStoreProvider.java:95)
>
> at
> at.quorum.teneo.client.internal.DBStoreProvider.startup(DBSt oreProvider.java:177)
>
> at
> at.quorum.octopus.io.OctopusCorePlugin.doStart(OctopusCorePl ugin.java:90)
> at
> at.quorum.octopus.io.OctopusCorePlugin.start(OctopusCorePlug in.java:68)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
>
> at
> org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:419)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
>
> at
> org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:33)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:441)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
> at
> at.quorum.octopus.executor.jmx.beans.JobplanManager.addJobpl an(JobplanManager.java:278)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenRetur n(ConvertingMethod.java:167)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:96)
>
> at
> com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIn trospector.java:33)
>
> at
> com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntro spector.java:208)
>
> at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.jav a:120)
> at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.jav a:262)
> at javax.management.StandardMBean.invoke(StandardMBean.java:391 )
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:836)
>
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer .java:761)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RM IConnectionImpl.java:1426)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$200(RMI ConnectionImpl.java:72)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOper ation.run(RMIConnectionImpl.java:1264)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOp eration(RMIConnectionImpl.java:1359)
>
> at
> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConn ectionImpl.java:788)
>
> at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:305)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspo rt.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TC PTransport.java:790)
>
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCP Transport.java:649)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.emf.teneo.PersistenceOptions
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.eclipse.emf.teneo.extension.DefaultExtensionManager.getE xtension(DefaultExtensionManager.java:143)
>
> ... 57 more
>
>
> I hope I have provided you with enogh information! Thank you for your
> answers!
>
> Best regards,
> Matthias
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] JMX MBean and class loading issues [message #619221 is a reply to message #125462] Mon, 09 June 2008 05:19 Go to previous message
Matthias Treitler is currently offline Matthias TreitlerFriend
Messages: 117
Registered: July 2009
Senior Member
Hello Martin,

Thank you for your help! Finally, it works ;) !!!!
As you suggested, I have set the ClassLoaderStrategy in the
ClassLoaderResolver class to "setClassLoaderStrategy(new
ClassClassLoaderStrategy());" in the static initializer.

Then I have added this code to my data store initialization part:
"localDataStore.getExtensionManager().registerExtension(
ClassLoaderStrategy.class.getName(),
ClassClassLoaderStrategy.class.getName());"

All my other plug-ins are working so far with this changes. But is there a
"cleaner" way to set the ClassLoaderStrategy without changing the
org.eclipse.emf.teneo plug-in?!? Why is not the ClassClassLoaderStrategy
the default one used?!? Is there a "bug" in Teneo?!?

Again, thank you for your help!

Matthias!
Re: [Teneo] JMX MBean and class loading issues [message #619227 is a reply to message #125516] Tue, 10 June 2008 13:07 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Matthias,
Good that it works, classloading issues are always very annoying.

Regarding this, afaics no there is no 'bug' in Teneo. I am not sure either if this can be tagged as
'changing the teneo plugin'. It is just setting an option just as also setting the database driver etc.
Maybe the strange thing with the classloader compared to other extensions is that you both have to
set the ClassLoaderStrategy in the ClassLoaderResolver. This can be made simpler I think to always
use the one defined in the ClassLoaderResolver. I will look at that.

My idea was/is that the context class loader (which uses the thread classloader) is a good default.

gr. Martin


Matthias wrote:
> Hello Martin,
>
> Thank you for your help! Finally, it works ;) !!!!
> As you suggested, I have set the ClassLoaderStrategy in the
> ClassLoaderResolver class to "setClassLoaderStrategy(new
> ClassClassLoaderStrategy());" in the static initializer.
>
> Then I have added this code to my data store initialization part:
> "localDataStore.getExtensionManager().registerExtension(
> ClassLoaderStrategy.class.getName(),
> ClassClassLoaderStrategy.class.getName());"
>
> All my other plug-ins are working so far with this changes. But is there
> a "cleaner" way to set the ClassLoaderStrategy without changing the
> org.eclipse.emf.teneo plug-in?!? Why is not the ClassClassLoaderStrategy
> the default one used?!? Is there a "bug" in Teneo?!?
>
> Again, thank you for your help!
>
> Matthias!
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:Save resource with validation
Next Topic:[EMF Search] Problem in wizard
Goto Forum:
  


Current Time: Fri Apr 03 09:43:19 GMT 2020

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

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

Back to the top