7 Replies Latest reply on Apr 28, 2004 11:11 PM by jbossy

    Getting QueueDepth with not working on JB400DDR2-3, working

    jbossy

      I have a small piece of code that gets the queueDepth from a queue remotely that works on 3.2.3 but not on 4.0.0DR2-DR3. Ive updated the client jars accordingly. Has something changed drastically for this mechanism?

      The error I get is:
      java.lang.NoClassDefFoundError: Lorg/jboss/mx/util/ObjectNamePatternHelper$PropertyPattern;

      The piece of code in question to get the QueueDepth is:

      //lookup the server
      RMIAdaptor server
      = (RMIAdaptor) context.lookup("jmx/rmi/RMIAdaptor");

      //use the queue name to get the object name
      ObjectName name
      = new ObjectName ("jboss.mq.destination:name=" + q.getQueueName() + ",service=Queue");

      //get the queue size from the queueDepth attribute string
      queueSize
      = Integer.parseInt((server.getAttribute(name, "QueueDepth")).toString());

      The jars I replaced on my client going from 3.2.3 to 4.0.0DR2,DR3 are:
      jbossall-client.jar
      jbossjmx-ant.jar
      log4j.jar(Probably irrelevant)

      Can someone tell me what I am doing wrong or what I am doing inadequately? Thank you all in advance, I wasnt able to find anything from several searches.

        • 1. Re: Getting QueueDepth with not working on JB400DDR2-3, work
          jbossy

          The topic title didnt turn out right. It should be:

          Getting QueueDepth remotely with 3.2.3 working, not working on JB400DDR2-3

          • 2. Re: Getting QueueDepth with not working on JB400DDR2-3, work
            genman


            You should file a bug, and include the .jar files in your classpath. This might be an issue in the upcoming JBoss 3.2.4 release. As a work-around, you can always include the appropriate server .jar files in your classpath for your client.

            • 3. Re: Getting QueueDepth with not working on JB400DDR2-3, work
              jbossy

              The classpath I believe should be correct, if the new version jars are named the same way. Could it be that I am missing another jar? I guess I searched for the "Lorg..." exception and turned up nothing on google. The same process worked from a working 3.0.7,3.0.8, to 3.2.2 and 3.2.3 and those worked.

              I forgot to mention that I did recompile everytime I swapped out the jar versions. I hope this is something trivial. You mentioned 3.2.4, I will see if it remains broken with the RC too.

              Can anyone else help me out? Thanks in advance!

              R

              • 4. Re: Getting QueueDepth with not working on JB400DDR2-3, work
                genman


                The "Lorg" means it's trying to load the class for an array of them.

                What you're really looking for is this file someplace:

                org/jboss/mx/util/ObjectNamePatternHelper.class

                • 5. RE: Missing org/jboss/mx/util/ObjectNamePatternHelper.class
                  jbossy

                   

                  "genman" wrote:

                  The "Lorg" means it's trying to load the class for an array of them.

                  What you're really looking for is this file someplace:

                  org/jboss/mx/util/ObjectNamePatternHelper.class


                  Well, you were right about it not working on 3.2.4RC1 the same way, I also came across another error where the JMS messages seem to have a new file size limit. Once adjusted the messages worked fine for the memory issue but still failed with the same exception. Ive never seen ObjectNamePatternHelper.class before and Im sure I dont reference it explicitly so I assume JBoss needs this for something internally.

                  Does anyone have a new example of how to access a jms destination object with the newer Jboss's ?

                  Thanks genman! The next thing I should do is see if I can find this class in other jars in the the client directory. I thought it would have broke in the compile step but it must be a runtime thing. If anyone else has more hints to this I'd appreciate it. If I don't have any success, I'll report a bug like you suggested.



                  • 6. Re: RE: Missing org/jboss/mx/util/ObjectNamePatternHelper.cl
                    jbossy

                     

                    "jbossy" wrote:
                    "genman" wrote:

                    The "Lorg" means it's trying to load the class for an array of them.

                    What you're really looking for is this file someplace:

                    org/jboss/mx/util/ObjectNamePatternHelper.class


                    Well, you were right about it not working on 3.2.4RC1 the same way, I also came across another error where the JMS messages seem to have a new file size limit. Once adjusted the messages worked fine for the memory issue but still failed with the same exception. Ive never seen ObjectNamePatternHelper.class before and Im sure I dont reference it explicitly so I assume JBoss needs this for something internally.

                    Does anyone have a new example of how to access a jms destination object with the newer Jboss's ?

                    Thanks genman! The next thing I should do is see if I can find this class in other jars in the the client directory. I thought it would have broke in the compile step but it must be a runtime thing. If anyone else has more hints to this I'd appreciate it. If I don't have any success, I'll report a bug like you suggested.



                    I wonder if the /mx should be /jmx perhaps .... still hunting it down ...

                    • 7. RE: Missing org/jboss/mx/util/ObjectNamePatternHelper.class
                      jbossy

                      I was able to make things work on 3.2.4RC1 and 4.0.0DR3 but not on 4.0.0DR2 so I dumped DR2. It turns out that the class reported in the exception doesnt exist in a jar in the jboss/client dir, but rather in the jboss-jmx.jar in the jboss/lib dir. I place this jar in my standalone clients lib directory and added to the classpath and it worked. What I dont understand is that none of my code uses that resource, didnt even need to touch the source code.

                      Genman, thanks for clarifying some things so that I could follow through with a fix. The jboss community continues to impress me, awesome.

                      Hopefully others trying to access jmx stuff can use this info for the newer jbosses.