![]() |
![]() |
|
[
Permalink
| « Hide
]
Emmanuel Venisse added a comment - 30/Mar/06 02:01 PM
patch for this issue.
Is it possible to add this patch in rc2?
What about providing a testcase so this is demonstratable the situation that it occurs ?
JDO2 specification provides clear definitions of what a JDO implementation should class resolve. I don't know if i can do a simple testcase. It appears in our application (Apache Continuum). Let me explain what's happen:
We have a central class that use jpox for database access. This class is loaded only one time by our IOC container and accessed by web interface and by xml-rpc. All works fine for access by web interface but not for access by xml-rpc. Our IOC container use an UrlClassLoader and in xmlrpc class i can access to javax.jdo.identity.IntIdentity but not in central class. The two parts have the same loader and use the same libraries. I have this problem since we have migrated to jpox rc-1, it worked fine with beta-4 I hope my explanations are clear. No. Not clear at all. If all is in the same ClassLoader then there is no issue and all will be loaded fine. You dont state in what ClassLoader are jdo.jar, jpox.jar. Without a reproduceable testcase nothing can be done. The PMF allows you to define a ClassLoader to use if you have things elsewhere.
What happened in beta-4 is irrelevant since that was not JDO2 compliant. rc-1 is JDO2 compliant. How can i define a classloader in PMF?
do you mean by running : Thread.currentThread().setContextClassLoader( myClassLoader); ?
How about reading the javadoc for JDO ?
I can see lots of methods for specifying the ClassLoader when creating your PMF ... for example JDOHelper.getPersistenceManagerFactory(propsFile, loader); post at least stacktrace and describe your classloaders like the below template
" boot clr -> system clr -> blabla 1 clr (jdo.jar - jpox.jar) -> blabla 1.1 clr -> blabla 1.2 clr (persistent classes) -> blabla 2 clr running thread is in blabla 2 clr. method invoked is pm.makePersistent(class.class) " I tried JDOHelper.getPersistenceManagerFactory(props, loader) but I get the same exception :
jvm 1 | org.apache.maven.continuum.ContinuumException: Error retrieving the requested project jvm 1 | at org.apache.maven.continuum.DefaultContinuum.getProjectWithAllDetails(DefaultContinuum.java:2168) jvm 1 | at org.apache.maven.continuum.xmlrpc.DefaultContinuumXmlRpc.getProject(DefaultContinuumXmlRpc.java:81) jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) jvm 1 | at java.lang.reflect.Method.invoke(Method.java:585) jvm 1 | at org.apache.xmlrpc.Invoker.execute(Unknown Source) jvm 1 | at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(Unknown Source) jvm 1 | at org.apache.xmlrpc.XmlRpcWorker.execute(Unknown Source) jvm 1 | at org.apache.xmlrpc.XmlRpcServer.execute(Unknown Source) jvm 1 | at org.apache.xmlrpc.XmlRpcServer.execute(Unknown Source) jvm 1 | at org.apache.xmlrpc.WebServer$Connection.run(Unknown Source) jvm 1 | at org.apache.xmlrpc.WebServer$Runner.run(Unknown Source) jvm 1 | at java.lang.Thread.run(Thread.java:595) jvm 1 | Caused by: org.apache.maven.continuum.store.ContinuumStoreException: Error handling JDO jvm 1 | at org.apache.maven.continuum.store.JdoContinuumStore.getObjectById(JdoContinuumStore.java:578) jvm 1 | at org.apache.maven.continuum.store.JdoContinuumStore.getProjectWithAllDetails(JdoContinuumStore.java:94 8) jvm 1 | at org.apache.maven.continuum.DefaultContinuum.getProjectWithAllDetails(DefaultContinuum.java:2160) jvm 1 | ... 13 more jvm 1 | Caused by: org.codehaus.plexus.jdo.PlexusStoreException: Error handling JDO jvm 1 | at org.codehaus.plexus.jdo.PlexusJdoUtils.getObjectById(PlexusJdoUtils.java:147) jvm 1 | at org.apache.maven.continuum.store.JdoContinuumStore.getObjectById(JdoContinuumStore.java:570) jvm 1 | ... 15 more jvm 1 | Caused by: org.jpox.exceptions.ClassNotResolvedException: Class javax.jdo.identity.IntIdentity was not found in the CLASSPATH. Please check your specification and your CLASSPATH. jvm 1 | at org.jpox.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:169) jvm 1 | at org.jpox.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:317) jvm 1 | at org.jpox.AbstractPersistenceManager.newObjectIdInstance(AbstractPersistenceManager.java:2351) jvm 1 | at org.codehaus.plexus.jdo.PlexusJdoUtils.getObjectById(PlexusJdoUtils.java:131) jvm 1 | ... 16 more If i apply my patch, all is ok. So we refer you back to what we asked for the first time. Provide a testcase that puts things into what ClassLoader's you are using, so then people have a chance of reproducing your situation.
All patches are irrelevent until they demonstrate some issue relative to the JDO2 spec. You havent run your patch against the JPOX unit tests, or the JDO2 TCK and they are our baseline for functionality I'm closing this since we have no definition of your class loading arrangement. When you can provide this information to satisfactorily demonstrate where the issue is then please raise a new issue and it will be investigated.
JPOX 1.1.1 provides the ability to specify your own ClassLoaderResolver "org.jpox.classLoaderResolverName" so you can provide your own class loading definition and do what you like
|
|||||||||||||||||||||||||||||||||||||