4 Replies Latest reply on Jul 1, 2009 10:40 AM by peterj

    NoClassDefFoundError in client class using jms Topic

    kyuss000

      HI,

      I have this very simple "Publisher" class connecting to a Topic: "orders".
      The xml file orders-Topic.xml is deployed in /server/default/deploy/jbossall-client.jar/.

      After compilation (javac -classpath Applications/jboss-4.0.2/client/jbossall-client.jar Purchase.java), I get this run-time error:

      java -classpath Applications/jboss-4.0.2/client/jbossall-client.jar Purchase

      Exception in thread "main" java.lang.NoClassDefFoundError: Publisher


      Where is the problem?!? Any suggestion?

      Thanks in advance.

        • 1. Re: NoClassDefFoundError in client class using jms Topic
          kyuss000

          Sorry, obviously Publisher and Purchase classes are the same class!

          • 2. Re: NoClassDefFoundError in client class using jms Topic
            peterj

             

            The xml file orders-Topic.xml is deployed in /server/default/deploy/jbossall-client.jar/.


            This makes no sense on two counts:
            First, when declaring a topic, it must be placed in a file named *-service.xml (e.g., orders-service.xml)
            Second, jbossall-client.jar is a file and not a directory, and it is located in the client directory, so I don't understand how you could deploy your file there.

            Sorry, obviously Publisher and Purchase classes are the same class!


            Does this mean you solved your compilation issue?

            • 3. Re: NoClassDefFoundError in client class using jms Topic
              kyuss000

               

              Does this mean you solved your compilation issue?

              I have not solved it yet.

              First, when declaring a topic, it must be placed in a file named *-service.xml (e.g., orders-service.xml)

              Ooops.

              Second, jbossall-client.jar is a file and not a directory

              I've found that on a tutorial, and it seemed strange to me as well. I had to create a new directory called jbossall-client.jar and deploy the file there.
              Clearly that was wrong.

              Ok, I'll try to change the xml file name and the deploy directory.

              Thank you very much.


              • 4. Re: NoClassDefFoundError in client class using jms Topic
                peterj

                You said: "obviously Publisher and Purchase classes are the same class!"

                What do you mean? Are you saying that class Publisher is declared in the file Purchase.java?

                Could you post the source for Purchase.java? (When posting source code, embed it within 'code' tags. To do this, select the source code and click the Code button above the editor window. Also, use the Preview button to check the formatting before clicking Submit.)