3 Replies Latest reply on Nov 10, 2010 4:17 PM by chausberger

    Cannot run HornetQ examples from shell or  Eclipse

    chausberger

      Hello,

       

      I've breen trying to run some of the examples as described in the docs but I get this error, for example with the QueueExample:

       

      runExample:
           [java] Exception in thread "main" java.lang.NoClassDefFoundError: ${client/args}
           [java] Caused by: java.lang.ClassNotFoundException: ${client.args}
           [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
           [java]     at java.security.AccessController.doPrivileged(Native Method)
           [java]     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
           [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
           [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
           [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
           [java] Could not find the main class: ${client.args}.  Program will exit.
           [java] Java Result: 1

       

       

      I used the ./build.sh command to run it as described in the docs. Any idea what is wrong here? I have the latest code from the trunk and use

      JDK 1.6.22 on a Linux machine.

       

      I also cannot run it from Eclipse 3.5:

      serverProps = null
      Nov 9, 2010 11:06:53 PM org.hornetq.common.example.HornetQExample run
      INFO: hornetq.example.runServer is true
      Nov 9, 2010 11:06:53 PM org.hornetq.common.example.HornetQExample getContext
      INFO: using server0/client-jndi.properties for jndi
      java.io.FileNotFoundException: server0/client-jndi.properties (No such file or directory)
          at java.io.FileInputStream.open(Native Method)
          at java.io.FileInputStream.<init>(FileInputStream.java:106)
          at org.hornetq.common.example.HornetQExample.getContext(HornetQExample.java:127)
          at org.hornetq.jms.example.QueueExample.runExample(QueueExample.java:46)
          at org.hornetq.common.example.HornetQExample.run(HornetQExample.java:71)
          at org.hornetq.jms.example.QueueExample.main(QueueExample.java:35)

       

      #####################
      ###    FAILURE!   ###
      #####################

       

       

      With Eclipse 3.6 it does not work att all and I get a ClassNotFoundException (the QueueExample class is not found by Eclipse). I had a closer look and found that the settings in the ".classpath" file are correct and the compiled classes are there, etc. This only happens with Eclipse 3.6.

       

       

      Can anybody tell me how to run the examples from a command line and from Eclipse (3.5 and if possible also 3.6). I am currently starting to use HornetQ at work and this is important to convince colleagues that this is a good move.

      Also I want to run the examples from Eclipse so I can use the debugger to step through the source code in order to get a deeper understanding of HornetQ.

       

      Any help welcome. I tried for several hours and without any results.

       

      Claus