9 Replies Latest reply on Nov 28, 2005 9:57 PM by adrian.brock

    ClassNotFoundException when deploying embedded RAR with ear

    ronnc

      I've posted this on JBoss User -> JCA/JBoss with no reply, perhaps someone here can comment on this?

      Regards,

      "ronnc" wrote:

      Posted: Tue Sep 13, 2005 02:29 AM Post subject: ClassNotFoundException when deploying embedded RAR with ear

      I have a RAR that is embedded in an EAR. My EAR deployer is set to use isolated class loader repository (non sharing). Upon deployment of the EAR, the RAR gets picked up but RARDeployment could not find the dependent classes (which reside solely in the EAR).

      It appears that I need to pull out those classes and put it in the share lib directory for RARDeployment to be able to find them.

      Is it possible to specify a EAR class repository for the RARDeployer ? Logically, if the RAR is inside an EAR I shouldn't need to pull apart the EAR just so that I can have isolated class loading scheme.

      Help/comments would be appreciated.

      14:01:40,948 ERROR [RARDeployment] Could not find ManagedConnectionFactory class: com.savi.common.reports.connector.server.ReportManagedConnectionFactory
      java.lang.ClassNotFoundException: No ClassLoaders found for: com.savi.common.reports.connector.server.ReportManagedConnectionFactory
       at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:198)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:475)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:377)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
       at org.jboss.resource.connectionmanager.RARDeployment.startService(RARDeployment.java:548)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:418)
       at org.jboss.system.ServiceController.start(ServiceController.java:440)
       at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy32.start(Unknown Source)
       at org.jboss.deployment.SimpleSubDeployerSupport.startService(SimpleSubDeployerSupport.java:378)
       at org.jboss.deployment.SimpleSubDeployerSupport.start(SimpleSubDeployerSupport.java:141)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:956)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
       at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy32.start(Unknown Source)
       at org.jboss.deployment.SimpleSubDeployerSupport.startService(SimpleSubDeployerSupport.java:378)
       at org.jboss.deployment.SimpleSubDeployerSupport.start(SimpleSubDeployerSupport.java:141)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:956)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
       at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:418)
       at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:434)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)
       at org.jboss.Main.boot(Main.java:195)
       at org.jboss.Main$1.run(Main.java:463)
       at java.lang.Thread.run(Thread.java:534)
      
      


        • 1. Re: ClassNotFoundException when deploying embedded RAR with
          starksm64

          Moved to user forum. What is not clear about the CNFE?

          • 2. Re: ClassNotFoundException when deploying embedded RAR with
            ronnc

            CNFE is clear but it is not the behaviour I expect. All required classes reside within the rar which is embeded in an ear. My question is - is it possible to deploy an embeded rar (in an ear) without having to extract out jars/classes from ear into the lib directory?

            BTW: this is jboss 4.0.2.

            • 3. Re: ClassNotFoundException when deploying embedded RAR with

              Works for me.
              org.jboss.test.deployers.ear.test.IsolatedEARDeployermentUnitTestCase

              • 4. Re: ClassNotFoundException when deploying embedded RAR with
                ronnc

                Thanks for the reply Adrian, I've found the cause of the CNFE. Basically rar deployment file of the embeded rar (-ds.xml) was residing outside the ear. When I moved it inside ear CNFE was resolved - make sense I supposed :)


                However, I still have some strange issue with isolated classloader - i.e., there are several jars inside the ear which bundle duplicated (and sometimes inconsitent version of) xml libraries. Somehow these libraries gets loaded and causes class cast exception and etc. After cleaning up and removing all the duplicates then JBoss will be happy. What I'm wondering is if JBoss uses parent first classloader delegation model then these library shouldn't cause any issue. The app orginally runs on Weblogic and I have ported the application to run on Websphere without these issue with duplicate xml libraries. Any insight or pointers would be appreciated.

                Regards,

                • 5. Re: ClassNotFoundException when deploying embedded RAR with
                  gavkearney

                  I'm having the same trouble as you Ronnc, just wondering what exactly you did to fix the classloader?
                  Is it me or is it the worst classloader ever in JBoss 4.0.2

                  Any help will be greatly appreciated, thanks in advance

                  • 6. Re: ClassNotFoundException when deploying embedded RAR with
                    ronnc

                    I've found that log4j, commons-logging and various javax.xml.parsers.*, org.w3c.*, javax.naming.* cause problems. So if you have any of these in your ear then you should remove them. Given that JBoss uses many popular opensource libraries, there might be more confict that I don't encounter.

                    I have yet to look into why this happens, technically, with parents first classloader delegation these problem shouldn't exists - esp if I am contented to go with what ever version of libraries that came with JBoss.

                    Regards,

                    • 7. Re: ClassNotFoundException when deploying embedded RAR with
                      dalvarezpy

                      Hello guys. I've had the same problem "Could not find ManagedConnectionFactory class:", but only since deploying to 4.0.3sp1. Prior to that, i didn't have the problem (4.0.2).

                      I had my -ds.xml file in the "deploy" directory. From what i understood from the messages before this, I tried moving it into the ear/meta-inf; it worked. My question is: what exactly is going on? why did it work in 4.0.2 but not in 4.0.3sp1 anymore? The "right" place for the -ds.xml is inside the EAR?

                      Thanks in advance,

                      Dario A.

                      • 8. Re: ClassNotFoundException when deploying embedded RAR with
                        dalvarezpy

                        Ok, it was not that beatiful, as it turned out that by including the -ds.xml file in the EAR file, the deployment stopped the, complaining but it's not working yet: the connector (connection factory) is never bound to the JNDI name, and nothing works.

                        Any ideas, suggestions, etc?

                        Thanks again,

                        Darío A.

                        • 9. Re: ClassNotFoundException when deploying embedded RAR with