7 Replies Latest reply on Mar 23, 2002 8:17 PM by pcallies

    java.lang.NoClassDefFoundError: org/jboss/jms/jndi/AbstractJ

    pcallies

      Using a freshly checked out and built 3.0.0beta2, I'm trying to integrate JBoss with MQSeries. Per some instructions in the messaging forum, I've created a JMSProviderAdapter for MQSeries and I'm trying to configure it. I've added the following to the jms-service.xml file and I've configured the message-driven bean container to use it in standardjboss.xml:


      MQSeriesJMSProvider
      com.mckhboc.realtime.common.edi.jms.JBossMQSeriesProvider
      file://c:/mqjndi
      pcallies
      TopicConnectionFactory


      I'm getting the following exception:

      14:13:40,001 INFO [JMSProviderLoader] Starting
      14:13:40,011 ERROR [MainDeployer] could not start deployment :file:/C:
      /jboss-tip/jboss-all/build/output/jboss-3.0.0beta2/server/default/depl
      oy/jms-service.xml
      java.lang.NoClassDefFoundError: org/jboss/jms/jndi/AbstractJMSProvider
      Adapter
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
      at java.security.SecureClassLoader.defineClass(SecureClassLoad
      er.java:111)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:248
      )
      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:297)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:28
      6)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
      at org.jboss.system.UnifiedClassLoader.loadClassLocally(Unifie
      dClassLoader.java:94)
      at org.jboss.system.ServiceLibraries.loadClass(ServiceLibrarie
      s.java:357)
      at org.jboss.system.UnifiedClassLoader.loadClass(UnifiedClassL
      oader.java:85)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:31
      3)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:120)
      at org.jboss.jms.jndi.JMSProviderLoader.startService(JMSProvid
      erLoader.java:118)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupp
      ort.java:162)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerIm
      pl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerIm
      pl.java:1523)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(Serv
      iceController.java:745)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.
      java:324)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerIm
      pl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerIm
      pl.java:1523)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:73)
      at $Proxy3.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:271
      )
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:6
      42)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:
      500)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:
      463)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerIm
      pl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerIm
      pl.java:1523)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:73)
      at $Proxy2.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(UR
      LDeploymentScanner.java:300)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirec
      tory(URLDeploymentScanner.java:506)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLD
      eploymentScanner.java:379)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.star
      tService(AbstractDeploymentScanner.java:228)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupp
      ort.java:162)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerIm
      pl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerIm
      pl.java:1523)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(Serv
      iceController.java:745)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.
      java:324)
      at org.jboss.system.ServiceController.start(ServiceController.
      java:342)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerIm
      pl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerIm
      pl.java:1523)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:
      326)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:20
      8)
      at org.jboss.Main.boot(Main.java:131)
      at org.jboss.Main$1.run(Main.java:364)
      at java.lang.Thread.run(Thread.java:484)

        • 1. Re: java.lang.NoClassDefFoundError: org/jboss/jms/jndi/Abstr


          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:28
          6)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
          at org.jboss.system.UnifiedClassLoader.loadClassLocally(Unifie
          dClassLoader.java:94)
          at org.jboss.system.ServiceLibraries.loadClass(ServiceLibrarie
          s.java:357)
          at org.jboss.system.UnifiedClassLoader.loadClass(UnifiedClassL
          oader.java:85)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:31
          3)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:120)
          at org.jboss.jms.jndi.JMSProviderLoader.startService(JMSProvid
          erLoader.java:118)


          This looks wrong. It shouldn't use Class.forName()
          You might want to report this as a bug, or ask in
          the Messaging forum.

          The class should be in lib/jboss.jar

          Regards,
          Adrian

          • 2. Re: java.lang.NoClassDefFoundError: org/jboss/jms/jndi/Abstr
            pcallies

            I'm pretty sure it's using Class.forName() to instantiate the class I wrote which extends AbstractJMSProviderAdapter.

            I added the head of my package to the JBOSS_CLASSPATH environment variable before starting the server. Is this the proper way to do this? If not, what is the proper way to test new code? Build a jar? I'm probably exposing my ignorance of classloader issues -- sorry.

            • 3. Re: java.lang.NoClassDefFoundError: org/jboss/jms/jndi/Abstr

              Hi,

              The correct solution is to fix the class
              org.jboss.jms.jndi.JMSProviderLoader
              to use
              Thread.currentThread().loadClass()
              not Class.forName()

              That's a problem with JBoss not you.
              I'd fix this myself, but I don't know how to test it.

              Do you have the source to make that modification?

              Regards,
              Adrian

              • 4. Re: java.lang.NoClassDefFoundError: org/jboss/jms/jndi/Abstr

                Oops,

                That should be
                Thread.currentThread().getContextClassLoader().loadClass()
                of course.

                Regards,
                Adrian

                • 5. Re: java.lang.NoClassDefFoundError: org/jboss/jms/jndi/Abstr
                  pcallies

                  Thanks for taking the time to help. I modified the code and re-built, but I'm getting the same exception. Any other ideas? Here's the modification I made:
                  //Class cls = Class.forName(providerAdapterClass);
                  Class cls = Thread.currentThread().getContextClassLoader().loadClass(providerAdapterClass);

                  • 6. Re: java.lang.NoClassDefFoundError: org/jboss/jms/jndi/Abstr

                    You said you added your package to JBOSS_CLASSPATH?
                    Is it still there?

                    Try putting it in the lib directory. It will become part
                    of the UnifiedClassLoading system.

                    The sun.misc.Launcher$AppClassLoader is the
                    vm's classpath which is a parent to the rest of jboss.
                    Parents can't access children for dynamic classloading.

                    It is possible to make your service hot-deployable for
                    when you need to change the code without rebooting,
                    but I'd get it working first.

                    Regards,
                    Adrian

                    • 7. Re: java.lang.NoClassDefFoundError: org/jboss/jms/jndi/Abstr
                      pcallies

                      That worked. Now I can at least get onto addressing other issues in the JMSContainerInvoker/JMSProviderLoader/ConnectionFactoryHelper.

                      If I get this working, I'll look through the guides to determine how to post my suggested fixes.

                      Thanks for your help.