openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter" <kwsut...@gmail.com>
Subject Re: Sun JDK problem with duplicate annotations
Date Thu, 31 Jul 2008 22:45:10 GMT
Just to document that this discussion has moved to OPENJPA-646 (and
OPENJPA-672).

On Tue, Jun 24, 2008 at 6:06 PM, Kevin Sutter <kwsutter@gmail.com> wrote:

> Hi,
> I've been debugging this problem for the last couple of days and I'm not
> sure where to go with this one...  Maybe someone with more Sun and Serp
> experience can help out...
>
> The scenario is that I have annotations doubly defined (ie.
> javax.persistence.OneToMany and alt.persistence.OneToMany).  A single entity
> might utilize both of them, like this:
>
>
> @javax.persistence.OneToMany(cascade=javax.persistence.CascadeType.REMOVE)
>     @alt.persistence.OneToMany(cascade=alt.persistence.CascadeType.REMOVE)
>     Collection<Fill> buySideFills;
>
> This results in the following callstack snippet when running with the
> -javaagent version of enhancement and the Sun JDK (fixpack 15):
>
> java.lang.ArrayStoreException:
> sun.reflect.annotation.AnnotationTypeMismatchExceptionProxy
>     at
> sun.reflect.annotation.AnnotationParser.parseEnumArray(AnnotationParser.java:673)
>     at
> sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:462)
>     at
> sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:286)
>     at
> sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
>     at
> sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
>     at
> sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
>     at java.lang.reflect.Field.declaredAnnotations(Field.java:1002)
>     at java.lang.reflect.Field.getDeclaredAnnotations(Field.java:995)
>     at
> java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:179)
>     at
> org.apache.openjpa.lib.util.J2DoPriv5Helper$1.run(J2DoPriv5Helper.java:51)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at
> org.apache.openjpa.persistence.PersistenceMetaDataDefaults.annotated(PersistenceMetaDataDefaults.java:293)
>     at
> org.apache.openjpa.persistence.PersistenceMetaDataDefaults.getAccessType(PersistenceMetaDataDefaults.java:262)
>     at
> org.apache.openjpa.persistence.PersistenceMetaDataDefaults.getAccessType(PersistenceMetaDataDefaults.java:250)
>     at
> org.apache.openjpa.meta.AbstractMetaDataDefaults.populate(AbstractMetaDataDefaults.java:155)
>     at
> org.apache.openjpa.persistence.PersistenceMetaDataDefaults.populate(PersistenceMetaDataDefaults.java:227)
>     at
> org.apache.openjpa.meta.MetaDataRepository.addMetaData(MetaDataRepository.java:794)
>     at
> org.apache.openjpa.meta.MetaDataRepository.addMetaData(MetaDataRepository.java:780)
>     at
> org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.getMetaData(AnnotationPersistenceMetaDataParser.java:657)
>     at
> org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.parseClassAnnotations(AnnotationPersistenceMetaDataParser.java:480)
>     at
> org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.parse(AnnotationPersistenceMetaDataParser.java:352)
>     at
> org.apache.openjpa.persistence.PersistenceMetaDataFactory.load(PersistenceMetaDataFactory.java:229)
>     at
> org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:474)
>     at
> org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:294)
>     at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:248)
>     at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:219)
>     at
> org.apache.openjpa.enhance.PCClassFileTransformer.transform0(PCClassFileTransformer.java:139)
>     at
> org.apache.openjpa.enhance.PCClassFileTransformer.transform(PCClassFileTransformer.java:120)
>     at
> sun.instrument.TransformerManager.transform(TransformerManager.java:122)
>     at
> sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155)
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>     at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>     at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>     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:268)
>     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:242)
>     at
> org.apache.openjpa.meta.MetaDataRepository.classForName(MetaDataRepository.java:1298)
>     at
> org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypes(MetaDataRepository.java:1280)
>     at
> org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:138)
>     at
> org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:119)
>     at
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:189)
>     at
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
>     at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
>     at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
>     at
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:1)
>
> If I run with the static PCEnhancer, no problem.
> If I run with the IBM JDK, no problem.
>
> I've narrowed this down the "CascadeType[] cascade" of the OneToMany
> annotation.  As a test, if I change this to not being an array
> (CascadeType), no problem.
>
> I've been experimenting with narrowing down the problem by writing a simple
> javaagent, but no luck yet.  One unique aspect of our javaagent is that we
> actually manipulate the bytes with Serp.  So, I started to bring Serp into
> the picture, but I keep getting linkage errors when attempting to get access
> to the Entity class.  (I do not claim to be a Serp expert.)
>
> Any ideas?
>
> Thanks,
> Kevin
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message