You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "David Jencks (JIRA)" <de...@geronimo.apache.org> on 2005/09/01 01:13:04 UTC

[jira] Created: (GERONIMO-964) Openejb proxy generation code assumes openejb classes can be loaded by interface's classloader

Openejb proxy generation code assumes openejb classes can be loaded by interface's classloader
----------------------------------------------------------------------------------------------

         Key: GERONIMO-964
         URL: http://issues.apache.org/jira/browse/GERONIMO-964
     Project: Geronimo
        Type: Bug
  Components: OpenEJB  
    Versions: 1.0-M5    
 Reporter: David Jencks
     Fix For: 1.0-M5


Openejb proxy generation code assumes that the openejb classes can be loaded by the interface's classloader.  This is false for MEJB if you put the jsr-77 classes in a parent of o/a/g/Server.

The code is:
    public CglibEJBProxyFactory(Class superClass, Class clientInterface) {
        this(superClass, clientInterface, clientInterface.getClassLoader());
    }

One workaround would be to see if either the superClass or interface classloader could load both classes and use that one.


The stack trace is:
15:29:28,344 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: objectName="geronimo.server:J2EEApplication=null,EJBModule=org/apache/geronimo/Server,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=ejb/mgmt/MEJB"
net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:236)
        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
        at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
        at org.openejb.proxy.CglibEJBProxyFactory.<init>(CglibEJBProxyFactory.java:88)
        at org.openejb.proxy.CglibEJBProxyFactory.<init>(CglibEJBProxyFactory.java:72)
        at org.openejb.proxy.CglibEJBProxyFactory.<init>(CglibEJBProxyFactory.java:68)
        at org.openejb.proxy.EJBProxyFactory.getFactory(EJBProxyFactory.java:303)
        at org.openejb.proxy.EJBProxyFactory.<init>(EJBProxyFactory.java:129)
        at org.openejb.proxy.EJBProxyFactory.<init>(EJBProxyFactory.java:97)
        at org.openejb.proxy.EJBProxyFactory.<init>(EJBProxyFactory.java:92)
        at org.openejb.mejb.MEJB.<init>(MEJB.java:123)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:875)
        at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:325)
        at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:110)
        at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:132)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:516)
        at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:210)
        at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:140)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:516)
        at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:210)
        at org.apache.geronimo.system.main.Daemon.doStartup(Daemon.java:246)
        at org.apache.geronimo.system.main.Daemon.<init>(Daemon.java:79)
        at org.apache.geronimo.system.main.Daemon.main(Daemon.java:309)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:218)
        ... 26 more
Caused by: java.lang.NoClassDefFoundError: org/openejb/proxy/SessionEJBObject
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        ... 31 more


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (GERONIMO-964) Openejb proxy generation code assumes openejb classes can be loaded by interface's classloader

Posted by "David Jencks (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-964?page=all ]
     
David Jencks closed GERONIMO-964:
---------------------------------


no one had a better idea

> Openejb proxy generation code assumes openejb classes can be loaded by interface's classloader
> ----------------------------------------------------------------------------------------------
>
>          Key: GERONIMO-964
>          URL: http://issues.apache.org/jira/browse/GERONIMO-964
>      Project: Geronimo
>         Type: Bug
>   Components: OpenEJB
>     Versions: 1.0-M5
>     Reporter: David Jencks
>     Assignee: David Jencks
>      Fix For: 1.0-M5

>
> Openejb proxy generation code assumes that the openejb classes can be loaded by the interface's classloader.  This is false for MEJB if you put the jsr-77 classes in a parent of o/a/g/Server.
> The code is:
>     public CglibEJBProxyFactory(Class superClass, Class clientInterface) {
>         this(superClass, clientInterface, clientInterface.getClassLoader());
>     }
> One workaround would be to see if either the superClass or interface classloader could load both classes and use that one.
> The stack trace is:
> 15:29:28,344 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: objectName="geronimo.server:J2EEApplication=null,EJBModule=org/apache/geronimo/Server,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=ejb/mgmt/MEJB"
> net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
>         at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:236)
>         at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
>         at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
>         at org.openejb.proxy.CglibEJBProxyFactory.<init>(CglibEJBProxyFactory.java:88)
>         at org.openejb.proxy.CglibEJBProxyFactory.<init>(CglibEJBProxyFactory.java:72)
>         at org.openejb.proxy.CglibEJBProxyFactory.<init>(CglibEJBProxyFactory.java:68)
>         at org.openejb.proxy.EJBProxyFactory.getFactory(EJBProxyFactory.java:303)
>         at org.openejb.proxy.EJBProxyFactory.<init>(EJBProxyFactory.java:129)
>         at org.openejb.proxy.EJBProxyFactory.<init>(EJBProxyFactory.java:97)
>         at org.openejb.proxy.EJBProxyFactory.<init>(EJBProxyFactory.java:92)
>         at org.openejb.mejb.MEJB.<init>(MEJB.java:123)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>         at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:875)
>         at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:325)
>         at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:110)
>         at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:132)
>         at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:516)
>         at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:210)
>         at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:140)
>         at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:516)
>         at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:210)
>         at org.apache.geronimo.system.main.Daemon.doStartup(Daemon.java:246)
>         at org.apache.geronimo.system.main.Daemon.<init>(Daemon.java:79)
>         at org.apache.geronimo.system.main.Daemon.main(Daemon.java:309)
> Caused by: java.lang.reflect.InvocationTargetException
>         at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
>         at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:218)
>         ... 26 more
> Caused by: java.lang.NoClassDefFoundError: org/openejb/proxy/SessionEJBObject
>         at java.lang.ClassLoader.defineClass0(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
>         ... 31 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (GERONIMO-964) Openejb proxy generation code assumes openejb classes can be loaded by interface's classloader

Posted by "David Jencks (JIRA)" <de...@geronimo.apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-964?page=all ]
     
David Jencks resolved GERONIMO-964:
-----------------------------------

    Resolution: Fixed
     Assign To: David Jencks

Pick a classloader that can load both classes.  Anyone have a better idea?  will close in a bit if no one speaks up.

Checking in modules/core/src/java/org/openejb/proxy/EJBProxyFactory.java;
new revision: 1.16; previous revision: 1.15


> Openejb proxy generation code assumes openejb classes can be loaded by interface's classloader
> ----------------------------------------------------------------------------------------------
>
>          Key: GERONIMO-964
>          URL: http://issues.apache.org/jira/browse/GERONIMO-964
>      Project: Geronimo
>         Type: Bug
>   Components: OpenEJB
>     Versions: 1.0-M5
>     Reporter: David Jencks
>     Assignee: David Jencks
>      Fix For: 1.0-M5

>
> Openejb proxy generation code assumes that the openejb classes can be loaded by the interface's classloader.  This is false for MEJB if you put the jsr-77 classes in a parent of o/a/g/Server.
> The code is:
>     public CglibEJBProxyFactory(Class superClass, Class clientInterface) {
>         this(superClass, clientInterface, clientInterface.getClassLoader());
>     }
> One workaround would be to see if either the superClass or interface classloader could load both classes and use that one.
> The stack trace is:
> 15:29:28,344 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: objectName="geronimo.server:J2EEApplication=null,EJBModule=org/apache/geronimo/Server,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=ejb/mgmt/MEJB"
> net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
>         at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:236)
>         at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
>         at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
>         at org.openejb.proxy.CglibEJBProxyFactory.<init>(CglibEJBProxyFactory.java:88)
>         at org.openejb.proxy.CglibEJBProxyFactory.<init>(CglibEJBProxyFactory.java:72)
>         at org.openejb.proxy.CglibEJBProxyFactory.<init>(CglibEJBProxyFactory.java:68)
>         at org.openejb.proxy.EJBProxyFactory.getFactory(EJBProxyFactory.java:303)
>         at org.openejb.proxy.EJBProxyFactory.<init>(EJBProxyFactory.java:129)
>         at org.openejb.proxy.EJBProxyFactory.<init>(EJBProxyFactory.java:97)
>         at org.openejb.proxy.EJBProxyFactory.<init>(EJBProxyFactory.java:92)
>         at org.openejb.mejb.MEJB.<init>(MEJB.java:123)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>         at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:875)
>         at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:325)
>         at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:110)
>         at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:132)
>         at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:516)
>         at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:210)
>         at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:140)
>         at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:516)
>         at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:210)
>         at org.apache.geronimo.system.main.Daemon.doStartup(Daemon.java:246)
>         at org.apache.geronimo.system.main.Daemon.<init>(Daemon.java:79)
>         at org.apache.geronimo.system.main.Daemon.main(Daemon.java:309)
> Caused by: java.lang.reflect.InvocationTargetException
>         at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
>         at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:218)
>         ... 26 more
> Caused by: java.lang.NoClassDefFoundError: org/openejb/proxy/SessionEJBObject
>         at java.lang.ClassLoader.defineClass0(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
>         ... 31 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira