On Oct 7, 2008, at 6:25 PM, Brian Dellert wrote:
Just some additional info on this issue: After further
investigation, it appears that this issue is related to runtime
enhancement of the JPA classes. That is, if I run the enhancer at
build time, the error does not occur.
Thanks for the info.
Seems to be a problem with the ClassLoader being used during this
annotation processing. Pretty sure it's either and IBM JVM issue or an
OpenJPA issue.
I'd start by using an OpenJPA 1.2.1-SNAPSHOT build. Kevin Sutter from
OpenJPA pointed me to https://issues.apache.org/jira/browse/
OPENJPA-646 as a possible culprit.
Looks like you'll need to build 1.2.1-SNAPSHOT from source, I don't
see a posted OpenJPA 1.2.1-SNAPSHOT nightly build.
After you build, place new jar in the server's repository and use var/
config/artifact_aliases.properties to cause this newer version of the
jar to be loaded.
--kevan
- Brian
----- Original Message -----
From: Brian Dellert
To: [email protected]
Sent: Monday, October 06, 2008 2:11 PM
Subject: Error using geronimo/OpenJPA on IBM Linux JVM
I have an application which is packaged in an ear file and leverages
EJB/JPA. One of my entity classes uses the OpenJPA-specific
ElementJoinColumn annotation. When I deploy this application on
Geronimo 2.0.2 on Linux using the Sun JVM, everything works
correctly. But, if I attempt this using the IBM 32-bit 1.5 or 1.6
LInux JVMs, I get the following warning when the geronimo server
starts up:
3761 myPU WARN [main] openjpa.Enhance - An exception was thrown
while attempting to perform class file transformation on "com/my/
company/ejb/entity/MyClass":
java.lang.TypeNotPresentException: Type
org.apache.openjpa.persistence.jdbc.ElementJoinColumn not present
at
com
.ibm
.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:38)
at
com
.ibm
.oti
.reflect
.AnnotationHelper.getDeclaredAnnotations(AnnotationHelper.java:50)
at com.ibm.oti.reflect.Method.getDeclaredAnnotations(Method.java:31)
at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:722)
at
java
.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:
191)
at com.ibm.oti.reflect.Method.getAnnotation(Method.java:20)
at java.lang.reflect.Method.getAnnotation(Method.java:711)
at
java
.lang
.reflect.AccessibleObject.isAnnotationPresent(AccessibleObject.java:
187)
at org.apache.openjpa.lib.util.J2DoPriv5Helper
$3.run(J2DoPriv5Helper.java:87)
at
java.security.AccessController.doPrivileged(AccessController.java:197)
at
org
.apache
.openjpa
.persistence
.PersistenceMetaDataDefaults
.getPersistenceStrategy(PersistenceMetaDataDefaults.java:119)
at
org
.apache
.openjpa
.persistence
.PersistenceMetaDataDefaults
.isDefaultPersistent(PersistenceMetaDataDefaults.java:315)
at
org
.apache
.openjpa
.meta
.AbstractMetaDataDefaults
.populateFromReflection(AbstractMetaDataDefaults.java:241)
at
org
.apache
.openjpa
.meta
.AbstractMetaDataDefaults.populate(AbstractMetaDataDefaults.java:168)
at
org
.apache
.openjpa
.persistence
.PersistenceMetaDataDefaults
.populate(PersistenceMetaDataDefaults.java:225)
at
org
.apache
.openjpa.meta.MetaDataRepository.addMetaData(MetaDataRepository.java:
752)
at
org
.apache
.openjpa.meta.MetaDataRepository.addMetaData(MetaDataRepository.java:
738)
at
org
.apache
.openjpa
.persistence
.AnnotationPersistenceMetaDataParser
.getMetaData(AnnotationPersistenceMetaDataParser.java:651)
at
org
.apache
.openjpa
.persistence
.AnnotationPersistenceMetaDataParser
.parseClassAnnotations(AnnotationPersistenceMetaDataParser.java:479)
at
org
.apache
.openjpa
.persistence
.AnnotationPersistenceMetaDataParser
.parse(AnnotationPersistenceMetaDataParser.java:351)
at
org
.apache
.openjpa
.persistence
.PersistenceMetaDataFactory.load(PersistenceMetaDataFactory.java:229)
at
org
.apache
.openjpa
.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:
433)
at
org
.apache
.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:
288)
at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:244)
at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:215)
at
org
.apache
.openjpa
.enhance
.PCClassFileTransformer.transform(PCClassFileTransformer.java:127)
at org.apache.openjpa.persistence.PersistenceProviderImpl
$ClassTransformerImpl.transform(PersistenceProviderImpl.java:170)
at
org
.apache
.geronimo
.persistence.TransformerWrapper.transform(TransformerWrapper.java:43)
at
org
.apache
.geronimo
.transformer
.TransformerCollection.transform(TransformerCollection.java:43)
at
sun.instrument.TransformerManager.transform(TransformerManager.java:
141)
at
sun
.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:
174)
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:258)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
151)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:589)
at java.net.URLClassLoader.access$400(URLClassLoader.java:123)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1034)
at
java.security.AccessController.doPrivileged(AccessController.java:279)
at java.net.URLClassLoader.findClass(URLClassLoader.java:491)
at
org
.apache
.geronimo
.kernel
.config
.MultiParentClassLoader
.loadOptimizedClass(MultiParentClassLoader.java:431)
at
org
.apache
.geronimo
.kernel
.config.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:
279)
at java.lang.ClassLoader.loadClass(ClassLoader.java:597)
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:68)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:129)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:163)
at
org
.apache
.openejb
.assembler
.classic.EnterpriseBeanBuilder.load(EnterpriseBeanBuilder.java:375)
at
org
.apache
.openejb
.assembler
.classic.EnterpriseBeanBuilder.loadClass(EnterpriseBeanBuilder.java:
355)
at
org
.apache
.openejb
.assembler
.classic.EnterpriseBeanBuilder.build(EnterpriseBeanBuilder.java:75)
at
org
.apache
.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:52)
at
org
.apache
.openejb
.assembler.classic.Assembler.createApplication(Assembler.java:489)
at
org
.apache
.openejb.assembler.classic.Assembler.createEjbJar(Assembler.java:370)
at
org
.apache
.geronimo
.openejb.OpenEjbSystemGBean.createEjbJar(OpenEjbSystemGBean.java:391)
at
org.apache.geronimo.openejb.EjbModuleImpl.start(EjbModuleImpl.java:
123)
at
org
.apache
.geronimo.openejb.EjbModuleImplGBean.doStart(EjbModuleImplGBean.java:
39)
at
org
.apache
.geronimo
.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:998)
at
org
.apache
.geronimo
.gbean
.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:
268)
at
org
.apache
.geronimo
.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
at
org
.apache
.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:541)
at
org
.apache
.geronimo
.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:
111)
at
org
.apache
.geronimo
.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:146)
at org.apache.geronimo.gbean.runtime.GBeanDependency
$1.running(GBeanDependency.java:120)
at
org
.apache
.geronimo
.kernel
.basic
.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:
176)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access
$300(BasicLifecycleMonitor.java:44)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor
$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:
254)
at
org
.apache
.geronimo
.gbean
.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:
294)
at
org
.apache
.geronimo
.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
at
org
.apache
.geronimo
.gbean
.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:
124)
at
org
.apache
.geronimo
.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:555)
at
org
.apache
.geronimo
.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:379)
at
org
.apache
.geronimo
.kernel
.config
.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:
456)
at
org
.apache
.geronimo
.kernel
.config
.KernelConfigurationManager.start(KernelConfigurationManager.java:188)
at
org
.apache
.geronimo
.kernel
.config
.SimpleConfigurationManager
.startConfiguration(SimpleConfigurationManager.java:562)
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at
org
.apache
.geronimo
.gbean
.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:
34)
at
org
.apache
.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
at
org
.apache
.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:832)
at
org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:
57)
at
org
.apache
.geronimo
.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
at
org
.apache
.geronimo
.kernel
.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:
96)
at org.apache.geronimo.kernel.config.EditableConfigurationManager$
$EnhancerByCGLIB$$ac6db992.startConfiguration(<generated>)
at
org
.apache
.geronimo.system.main.EmbeddedDaemon.doStartup(EmbeddedDaemon.java:
162)
at
org
.apache
.geronimo.system.main.EmbeddedDaemon.execute(EmbeddedDaemon.java:79)
at
org
.apache
.geronimo
.kernel
.util
.MainConfigurationBootstrapper
.main(MainConfigurationBootstrapper.java:45)
at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:
67)
at org.apache.geronimo.cli.daemon.DaemonCLI.main(DaemonCLI.java:30)
Caused by: java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.jdbc.ElementJoinColumn
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:163)
at
com
.ibm
.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:33)
... 88 more
This effectively breaks things at runtime since OpenJPA ends up in a
bad state. It should be noted that I have tried this with Geronimo
2.1.3 as well, but get the same error. The version info for the
JVMs I am using is as follows:
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build
pxi32devifx-20080811b (SR8a))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32
j9vmxi3223ifx-20080811 (JIT enabled)
J9VM - 20080809_21892_lHdSMr
JIT - 20080620_1845_r8
GC - 200806_19)
JCL - 20080811a
java version "1.6.0"
Java(TM) SE Runtime Environment (build pxi3260sr2-20080818_01(SR2))
IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 Linux x86-32
jvmxi3260-20080816_22093 (JIT enabled, AOT enabled)
J9VM - 20080816_022093_lHdSMr
JIT - r9_20080721_1330ifx2
GC - 20080724_AA)
JCL - 20080808_02
It should also be noted that I am seeing the same error when using
the IBM JVM on AIX.
Any insight into what might be causing this issue would be greatly
appreciated. Thanks.
- Brian