geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "YunFeng Ma (JIRA)" <j...@apache.org>
Subject [jira] Commented: (GERONIMO-3317) "has not been enhanced" error when invoking an EJB 2.1 Entity Bean
Date Mon, 06 Aug 2007 07:11:59 GMT

    [ https://issues.apache.org/jira/browse/GERONIMO-3317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517841
] 

YunFeng Ma commented on GERONIMO-3317:
--------------------------------------

I retested my sample using latest geronimo and the "has not been enhanced" error had gone,
but get a new error:

13:33:22,859 ERROR [OpenEJB] The bean instances business method encountered a sy
stem exception: org.apache.openejb.core.cmp.cmp2.Cmp2Entity
java.lang.NoClassDefFoundError: org.apache.openejb.core.cmp.cmp2.Cmp2Entity
        at java.lang.ClassLoader.defineClassImpl(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:223)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:162)
        at serp.bytecode.BCClassLoader.findClass(BCClassLoader.java:73)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:602)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:568)
        at java.lang.ClassLoader.defineClassImpl(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:223)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:162)
        at serp.bytecode.BCClassLoader.findClass(BCClassLoader.java:73)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:602)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:568)
        at java.lang.Class.forNameImpl(Native Method)
        at java.lang.Class.forName(Class.java:160)
        at org.apache.openjpa.util.GeneratedClasses.loadBCClass(GeneratedClasses.java:68)
        at org.apache.openjpa.enhance.ManagedClassSubclasser.write(ManagedClassSubclasser.java:193)
        at org.apache.openjpa.enhance.ManagedClassSubclasser.access$000(ManagedClassSubclasser.java:48)
        at org.apache.openjpa.enhance.ManagedClassSubclasser$1.write(ManagedClassSubclasser.java:96)
        at org.apache.openjpa.enhance.PCEnhancer.record(PCEnhancer.java:522)
        at org.apache.openjpa.enhance.PCEnhancer.record(PCEnhancer.java:510)
        at org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:114)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:615)
        at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:286)
        at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:196)
        at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:190)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:55)
        at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.createEntityManager(CMPEntityManagerTxScoped.java:74)
        at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.getEntityManager(CMPEntityManagerTxScoped.java:55)
        at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.getDelegate(CMPEntityManagerTxScoped.java:315)
        at org.apache.openejb.core.cmp.jpa.JpaCmpEngine.registerListener(JpaCmpEngine.java:128)
        at org.apache.openejb.core.cmp.jpa.JpaCmpEngine.getEntityManager(JpaCmpEngine.java:109)
        at org.apache.openejb.core.cmp.jpa.JpaCmpEngine.loadBean(JpaCmpEngine.java:170)
        at org.apache.openejb.core.cmp.CmpContainer.findByPrimaryKey(CmpContainer.java:687)
        at org.apache.openejb.core.cmp.CmpContainer.invoke(CmpContainer.java:284)
        at org.apache.openejb.core.entity.EntityEjbHomeHandler.findX(EntityEjbHomeHandler.java:57)
        at org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:160)
        at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:229)
        at org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
        at $Proxy35.findByPrimaryKey(Unknown Source)
        at javaUtility.EjbUtility.getUser(EjbUtility.java:105)
        at servlets.WelcomeServlet.doPost(WelcomeServlet.java:71)
        at servlets.GVTServlet.service(GVTServlet.java:89)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
        at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:351)
        at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:803)

The roor cause is the following codes in OpenJPA: 
{code}
package org.apache.openjpa.util;

public class GeneratedClasses {

    /**
     * Return the more derived loader of the class laoders for the given 
     * classes.
     */
    public static ClassLoader getMostDerivedLoader(Class c1, Class c2) {
        ClassLoader l1 = (ClassLoader) AccessController.doPrivileged(
            J2DoPrivHelper.getClassLoaderAction(c1));
        ClassLoader l2 = (ClassLoader) AccessController.doPrivileged(
            J2DoPrivHelper.getClassLoaderAction(c2));
        if (l1 == l2)
            return l1;
        if (l1 == null)
            return l2;
        if (l2 == null)
            return l1;

        for (ClassLoader p = (ClassLoader) AccessController.doPrivileged(
                J2DoPrivHelper.getParentAction(l1)); p != null;
                p = (ClassLoader) AccessController.doPrivileged(
                    J2DoPrivHelper.getParentAction(p)))
            if (p == l2)
                return l1;
        return l2;
    }
{code}

The classloader of c1 is [org.apache.geronimo.kernel.classloader.JarFileClassLoader id=SVT/GVTLibrary/2.0/car].
The classloader of c2 is [org.apache.geronimo.kernel.classloader.JarFileClassLoader id=org.apache.geronimo.configs/openjpa/2.0-SNAPSHOT/car].
The expected returned classloader is the classloader of c1, but classloader [org.apache.geronimo.kernel.classloader.JarFileClassLoader
id=org.apache.geronimo.configs/openjpa/2.0-SNAPSHOT/car] is not the parent of classloader
[org.apache.geronimo.kernel.classloader.JarFileClassLoader id=SVT/GVTLibrary/2.0/car], it's
just in the field "parents" arraylist of classloader [org.apache.geronimo.kernel.classloader.JarFileClassLoader
id=SVT/GVTLibrary/2.0/car] which is customized by org.apache.geronimo.kernel.classloader.JarFileClassLoader.
So this method always returns the classloader of c2.

> "has not been enhanced" error when invoking an EJB 2.1 Entity Bean
> ------------------------------------------------------------------
>
>                 Key: GERONIMO-3317
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3317
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: OpenEJB
>    Affects Versions: 2.0-M7
>            Reporter: Song
>            Assignee: Kevan Miller
>            Priority: Critical
>             Fix For: 2.1
>
>         Attachments: GERONIMO-3317.patch, gvtlibTable.ddl
>
>
> My application could be deployed successfully. 
> But when launching an Entity Bean, "has not been enhanced" error is thrown:
> 17:07:58,593 ERROR [OpenEJB] The bean instances business method encountered a system
exception: The type "class openejb.gvtlibrary.EJBUser" has not been enhanced.
> <1.0.0-SNAPSHOT-SNAPSHOT fatal user error> org.apache.openjpa.persistence.ArgumentException:
The type "class openejb.gvtlibrary.EJBUser" has not been enhanced.
>         at org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1610)
>         at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1584)
>         at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:663)
>         at org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:563)
>         at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:488)
>         at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:290)
>         at org.apache.openjpa.kernel.BrokerImpl.newObjectId(BrokerImpl.java:1089)
>         at org.apache.openjpa.kernel.DelegatingBroker.newObjectId(DelegatingBroker.java:257)
>         at org.apache.openjpa.persistence.EntityManagerImpl.find(EntityManagerImpl.java:348)
>         at org.apache.geronimo.persistence.CMPEntityManagerTxScoped.find(CMPEntityManagerTxScoped.java:125)
>         at org.apache.openejb.core.cmp.jpa.JpaCmpEngine.loadBean(JpaCmpEngine.java:171)
>         at org.apache.openejb.core.cmp.CmpContainer.findByPrimaryKey(CmpContainer.java:687)
>         at org.apache.openejb.core.cmp.CmpContainer.invoke(CmpContainer.java:284)
>         at org.apache.openejb.core.entity.EntityEjbHomeHandler.findX(EntityEjbHomeHandler.java:57)
>         at org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:160)
>         at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:230)
>         at org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
>         at $Proxy51.findByPrimaryKey(Unknown Source)
>         at javaUtility.EjbUtility.getUser(EjbUtility.java:105)
>         at servlets.WelcomeServlet.doPost(WelcomeServlet.java:71)
>         at servlets.GVTServlet.service(GVTServlet.java:89)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>         at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
>         at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:351)
>         at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>         at java.lang.Thread.run(Thread.java:801)
> org.apache.openejb.InvalidateReferenceException: java.rmi.RemoteException: The bean encountered
a non-application exception.; nested exception is:
>         <1.0.0-SNAPSHOT-SNAPSHOT fatal user error> org.apache.openjpa.persistence.ArgumentException:
The type "class openejb.gvtlibrary.EJBUser" has not been enhanced.: The bean encountered a
non-application exception.; nested exception is:
>         <1.0.0-SNAPSHOT-SNAPSHOT fatal user error> org.apache.openjpa.persistence.ArgumentException:
The type "class openejb.gvtlibrary.EJBUser" has not been enhanced.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message