7 Replies Latest reply on Sep 7, 2009 2:15 PM by Brian McCarty

    java.lang.NoClassDefFoundError on JMS client startup

    Brian McCarty Newbie

      Since moving to HornetQ 2.0 Beta 5 away from JBM 2.0 Beta 4, my JMS client application is receiving several java.lang.NoClassDefFoundError exceptions when the client jvm starts up.

      It does not seem to cause any issue with connecting the client to a HQ instance but is a little annoying.

      I am using a recent release of IBM JRE 1.5 with these additional jars from the Beta 5 in my classpath:

      jnp-client.jar
      hornetq-jms-client.jar
      hornetq-core-client.jar
      netty.jar
      hornetq-transports.jar.

      Has anybody else had this problem? Do I just need to add some other jars for clients using JMS support?

      The exceptions are for these classes:

      com.arjuna.ats.jta.recovery.XAResourceRecovery
      com.google.inject.AbstractModule
      com.google.inject.Provider
      javassist.bytecode.annotation.MemberValueVisitor
      javassist.util.proxy.MethodFilter
      javassist.util.proxy.MethodHandler
      javax.activation.DataSource
      javax.servlet.http.HttpServlet
      org.jboss.test.AbstractTestCaseWithSetup
      org.jboss.test.AbstractTestDelegate
      org.jboss.util.naming.Util
      org.jboss.xnio.IoFuture$Notifier
      org.jboss.xnio.IoHandler
      org.jboss.xnio.IoHandlerFactory
      org.osgi.framework.BundleActivator
      org.osgi.util.tracker.ServiceTracker
      org.springframework.beans.factory.InitializingBean

      While loading:

      org.hornetq.jms.server.recovery.HornetQXAResourceRecovery.
      org.jboss.annotation.factory.javassist.MemberValueGetter.
      org.jboss.annotation.factory.javassist.ProxyMapCreator.
      org.jboss.kernel.plugins.lazy.JavassistLazyInitializer$1.
      org.jboss.kernel.plugins.lazy.JavassistLazyInitializer$LazyHandler.
      org.jboss.naming.Util.
      org.jboss.netty.channel.socket.http.HttpTunnelingServlet.
      org.jboss.netty.channel.xnio.AbstractXnioChannelHandler.
      org.jboss.netty.channel.xnio.XnioAcceptedChannelHandler.
      org.jboss.netty.channel.xnio.XnioAcceptedChannelHandlerFactory.
      org.jboss.netty.channel.xnio.XnioClientChannelHandler.
      org.jboss.netty.channel.xnio.XnioClientChannelSink$FutureConnectionNotifier.
      org.jboss.netty.container.guice.AbstractChannelFactoryProvider.
      org.jboss.netty.container.guice.NettyModule.
      org.jboss.netty.container.guice.NioClientSocketChannelFactoryProvider.
      org.jboss.netty.container.guice.NioDatagramChannelFactoryProvider.
      org.jboss.netty.container.guice.NioServerSocketChannelFactoryProvider.
      org.jboss.netty.container.guice.OioClientSocketChannelFactoryProvider.
      org.jboss.netty.container.guice.OioDatagramChannelFactoryProvider.
      org.jboss.netty.container.guice.OioServerSocketChannelFactoryProvider.
      org.jboss.netty.container.osgi.NettyBundleActivator.
      org.jboss.netty.container.spring.NettyResourceFactory.
      org.jboss.netty.logging.OsgiLoggerFactory$1.
      org.jboss.test.kernel.junit.MicrocontainerTest.
      org.jboss.test.kernel.junit.MicrocontainerTestDelegate.
      org.jboss.xb.binding.sunday.xop.SimpleDataSource.

        • 2. Re: java.lang.NoClassDefFoundError on JMS client startup
          Brian McCarty Newbie

          Thanks for the update. If you could also mention in the JIRA that we are using IBM JRE 1.5 so it really needs to work with that also. I noticed that you mentioned IBM JRE 1.6 which we will not be able to move to for some time.

          If you need me to test a fix of some kind please let me know.

          Thanks,

          BMMc.

          • 3. Re: java.lang.NoClassDefFoundError on JMS client startup
            Clebert Suconic Master

            I couldn't verify IBM JDk 1.5 so far. It doesn't work on SE Linux (it tries some weird memory allocations that will be blocked by the latest SE Kernel)

            So, I just assumed if it doesn't work on 1.6 it wouldn't on 1.5 also.

            • 4. Re: java.lang.NoClassDefFoundError on JMS client startup
              Tim Fox Master

              This is very strange - if you're using just hornetq client and server (or even HornetQ jms), then it doesn't have dependencies on any of those classes you list.

              Can you explain what are you are trying to do in more detail? Maybe you're starting HornetQ standalone, or in JBoss AS? If so, what version?

              If you're just starting a HornetQ client (and you're using JMS) it simply has dependencies on a the hornetq-core-client, hornetq-jms-api, horneq-jms-client and netty. Certainly it doesn't use AOP, XAResourceRecovery, javaassist!, xnio!.

              Something else must be trying to load these classes - it won't be HornetQ

              • 5. Re: java.lang.NoClassDefFoundError on JMS client startup
                Brian McCarty Newbie

                Maybe a good place to start is to confirm what JARs should be required on the classpath for Beta 5 on a 1.5 JRE to make a JMS client application work?

                There maybe some kind of conflict with Spring and IBM JRE 1.5 I am trying to sort out that may not be related to you, but if you could please just confirm the minimum jars required for a JMS client acessing a HornetQ server that would help.

                PS: I am definately not getting these errors trying to startup HornetQ...but for HornetQ standalone/non-clustered JVM I am using the latest Sun JRE 1.6 available.

                Thanks,

                BMMc.

                • 6. Re: java.lang.NoClassDefFoundError on JMS client startup
                  Tim Fox Master

                   

                  "bmmc" wrote:
                  Maybe a good place to start is to confirm what JARs should be required on the classpath for Beta 5 on a 1.5 JRE to make a JMS client application work?

                  There maybe some kind of conflict with Spring and IBM JRE 1.5 I am trying to sort out that may not be related to you, but if you could please just confirm the minimum jars required for a JMS client acessing a HornetQ server that would help.


                  There's a whole chapter on this on the user manual ;)

                  http://hornetq.sourceforge.net/docs/hornetq-2.0.0.BETA5/user-manual/en/html/client-classpath.html



                  • 7. Re: java.lang.NoClassDefFoundError on JMS client startup
                    Brian McCarty Newbie

                    I had read that before and configured based on it but since I was having troubles I thought it wouldn't hurt to ask.

                    I was able to resolve the classnotfound's. Since I am running the client under WebSphere Message Broker I had to do some things differently that is normally required for configuring a simple classpath on a JVM. It wouldn't really help to explain it here because it wouldn't make any sense unless you are familiar with WMB's Java support. However, if anyone is interested in what I found out and is using WMB 6.1 feel free to drop me a private e-mail and I will fill you in bmmc@mac.com.

                    Apparently Clebert found an issue with IBM's JRE also that now I am not sure if it is the same as the problem I was having. Nevertheless I would be interested in the results of the JIRA he opened.

                    Thanks,

                    BMMc.