4 Replies Latest reply on Feb 20, 2008 3:47 PM by paradisonoir

    Having problem in upgrading to JBOSS AS 4.2.2.GA

    paradisonoir

      Hi,

      Previously I worked with older versions of JBOSS AS, and I did not have any problem in running my JMS applications. I installed the new JBOSS AS 4.2.2.GA, and followed the installation step by step as explained in the documentations. I created same queues and connection factory, but I still get either of these errors:

      1)Exception in thread "main" java.lang.NoClassDefFoundError: javax/jms/Destination

      2)Exception in thread "main" java.lang.NoClassDefFoundError: javax/jms/JMSException

      I noticed that it might be because of the JMS libraries which are not properly set in the CLASSPATH, but I checked, and it's fine and the same as before without any change.

      The only thing which I think might be problematic is I am linking my "J2EE_HOME" to a j2ee.jar file in Sun Application Server folder. It was the same before working without any problem, but do you think it might be because of that ?

      Any suggestion or idea?

      Regards,

        • 1. Re: Having problem in upgrading to JBOSS AS 4.2.2.GA
          peterj

          Are you using JBossAS 4.2.2 as is, or did you install JBoss Messaging?

          Please post the contents of the *-service.xml file that declares the queues and the connection factory. Also, why are you declaring another connection factory instead of using the one provided?

          Please post the full stack trace for the errors.

          You should not need to set the CLASSPATH to anything - mine is empty. The JBossAS should find the JMS classes just fine at server/xxx/lib/jboss-j2ee.jar.

          Finally, as far as I can tell, JBossAS uses J2EE_HOME only if the jboss.deploy.dir is not set (which it always is), and then only under special circumstances. So I doubt that has any bearing on the problem.

          • 2. Re: Having problem in upgrading to JBOSS AS 4.2.2.GA
            paradisonoir

            1- Yes, I installed JBoss Messaging as explained in the documentation.

            2- I use the pre-defined connection factory in Jboss("ConnectionFactory")

            3- In below, first you would see my error and at the end content of xml file in C:\jboss\server\messaging\deploy\jboss-messaging.sar\destinations-service.xml

            ============Error================
            sanity-check:

            init:

            compile:
            [javac] Compiling 1 source file to C:\workspace\message\s\output

            run:
            [java] Search for Lookup service on IP address: -Xms512m -Xmx1024m
            [java] Worker IP: 132.205.158.248
            [java] Before error
            [java] Exception in thread "main" java.lang.NoClassDefFoundError: javax/jms/Destination

            [java] at org.jboss.example.jms.queue.DemandWorker.getResult(Worker.java:170)
            [java] at org.jboss.example.jms.queue.DemandWorker.runSpecifiedIP(Worker.java:101)
            [java] at org.jboss.example.jms.queue.DemandWorker.(Worker.java:143)
            [java] at org.jboss.example.jms.queue.DemandWorker.main(Worker.java:326)
            =========================================


            ==============destinations-service.xml============

            <?xml version="1.0" encoding="UTF-8"?>

            <!--
            Messaging Destinations deployment descriptor.

            $Id: destinations-service.xml 1930 2007-01-09 18:16:04Z timfox $
            -->



            <!--
            The Default Dead Letter Queue. This destination is a dependency of an EJB MDB container.
            -->

            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=DLQ"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice


            <!--
            The Default Expiry Queue.
            -->

            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=ExpiryQueue"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice


            <!--
            Example destinations.
            -->

            <mbean code="org.jboss.jms.server.destination.TopicService"
            name="jboss.messaging.destination:service=Topic,name=testTopic"
            xmbean-dd="xmdesc/Topic-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice









            <mbean code="org.jboss.jms.server.destination.TopicService"
            name="jboss.messaging.destination:service=Topic,name=securedTopic"
            xmbean-dd="xmdesc/Topic-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice







            <mbean code="org.jboss.jms.server.destination.TopicService"
            name="jboss.messaging.destination:service=Topic,name=testDurableTopic"
            xmbean-dd="xmdesc/Topic-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice









            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=testQueue"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice









            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=A"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice


            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=GIPSYQueue1"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice


            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=GIPSYQueue2"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice


            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=B"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice


            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=C"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice


            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=D"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice


            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=ex"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice


            <!-- It's possible for indiviual queues and topics to use a specific queue for
            an expiry or DLQ -->

            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=PrivateDLQ"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice


            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice


            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=QueueWithOwnDLQAndExpiryQueue"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice
            jboss.messaging.destination:service=Queue,name=PrivateDLQ
            jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue


            <mbean code="org.jboss.jms.server.destination.TopicService"
            name="jboss.messaging.destination:service=Topic,name=TopicWithOwnDLQAndExpiryQueue"
            xmbean-dd="xmdesc/Topic-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice
            jboss.messaging.destination:service=Queue,name=PrivateDLQ
            jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue


            <!-- Queues and Topics can also specify their own redelivery delay -->

            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=QueueWithOwnRedeliveryDelay"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice
            5000


            <mbean code="org.jboss.jms.server.destination.TopicService"
            name="jboss.messaging.destination:service=Topic,name=TopicWithOwnRedeliveryDelay"
            xmbean-dd="xmdesc/Topic-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice
            5000


            <!--
            Example clustered destinations.
            -->

            <mbean code="org.jboss.jms.server.destination.QueueService"
            name="jboss.messaging.destination:service=Queue,name=testDistributedQueue"
            xmbean-dd="xmdesc/Queue-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice
            true


            <mbean code="org.jboss.jms.server.destination.TopicService"
            name="jboss.messaging.destination:service=Topic,name=testDistributedTopic"
            xmbean-dd="xmdesc/Topic-xmbean.xml">
            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
            jboss.messaging:service=PostOffice
            true



            =============================

            • 3. Re: Having problem in upgrading to JBOSS AS 4.2.2.GA
              peterj

              Oh, so the error is on the client side. I thought you were getting the errors on the server side.

              For a client, you need to include the proper set of jar files. The jar that contains the javax.jms package is client/jboss-j2ee.jar. Note that the javax.jms package is not included in the jboss-messaging-client.jar file that comes with JBoss Messaging.

              • 4. Re: Having problem in upgrading to JBOSS AS 4.2.2.GA
                paradisonoir

                Hi Peter,

                Your response was really helpful as it led me to include all necessary jar files in my ant file.

                For further reference to similar problems, all required files are mentioned in this address

                http://labs.jboss.com/file-access/default/members/jbossmessaging/freezone/docs/userguide-1.3.0.GA/html/installation.html#inst.remoteclient

                Thanks