12 Replies Latest reply on Aug 23, 2012 5:03 PM by Justin Bertram

    Help.  I want to scream, trying to run examples.

    markorocko Newbie

      So I'm just trying to cut my teeth on HornetQ and run the examples on Windows.

      This is what I'm doing.

      Download any version of hornetq

      Go to this directory:

      C:\hornetq-2.1.2.Final\examples\jms\queue\build

      I get this.  I know the error points to java version but I have changed my path and JAVA_HOME to both JDK 5 and JDK6 and still get the same error.

      Please advise.

       

      C:\APIsAndSamples\HornetQ\hornetq-2.1.2.Final\examples\jms\queue>build

      Build script found javac.

      hit alternate

      Using the following ant version from ..\..\..\tools\ant:

      calling ..\..\..\tools\ant\bin\ant.bat -version

      Apache Ant version 1.7.1 compiled on June 27 2008

      calling ..\..\..\tools\ant\bin\ant.bat  -Dhornetq.run_script=true

      Buildfile: build.xml

       

      run:

       

      init:

       

      compile:

           [echo] src.example.dir=C:\APIsAndSamples\HornetQ\hornetq-2.1.2.Final\examples\jms\que

      ue\src

          [javac] Compiling 6 source files to C:\APIsAndSamples\HornetQ\hornetq-2.1.2.Final\exam

      ples\jms\queue\build\classes

          [javac] C:\APIsAndSamples\HornetQ\hornetq-2.1.2.Final\examples\common\src\org\hornetq\

      common\example\SpawnedHornetQServer.java:16: cannot access org.hornetq.integration.bootstr

      ap.HornetQBootstrapServer

          [javac] bad class file: C:\APIsAndSamples\HornetQ\hornetq-2.1.2.Final\lib\hornetq-boot

      strap.jar(org/hornetq/integration/bootstrap/HornetQBootstrapServer.class)

          [javac] class file has wrong version 50.0, should be 49.0

          [javac] Please remove or make sure it appears in the correct subdirectory of the class

      path.

          [javac] import org.hornetq.integration.bootstrap.HornetQBootstrapServer;

          [javac]                                          ^

          [javac] 1 error

       

      BUILD FAILED

      C:\APIsAndSamples\HornetQ\hornetq-2.1.2.Final\examples\jms\queue\build.xml:22: The followi

      ng error occurred while executing this line:

      C:\APIsAndSamples\HornetQ\hornetq-2.1.2.Final\examples\common\build.xml:126: Compile faile

      d; see the compiler error output for details.

       

      Total time: 1 second

      Done

        • 1. Re: Help.  I want to scream, trying to run examples.
          Justin Bertram Master

          I just downloaded HornetQ 2.2.14 from http://downloads.jboss.org/hornetq/hornetq-2.2.14.Final.zip, and then I did the following:

           

          jbertram@jbertram-laptop-510 ~/Downloads $ unzip hornetq-2.2.14.Final.zip 
          Archive:  hornetq-2.2.14.Final.zip
             creating: hornetq-2.2.14.Final/
             ...
          jbertram@jbertram-laptop-510 ~/Downloads $ cd hornetq-2.2.14.Final/examples/jms/queue
          jbertram@jbertram-laptop-510 ~/Downloads/hornetq-2.2.14.Final/examples/jms/queue $ ./build.sh 
          ANT_HOME is ../../../tools/ant
          Found javac
          Using the following ant version from ../../../tools/ant:
          Apache Ant version 1.7.1 compiled on June 27 2008
          Buildfile: build.xml
          
          
          run:
          
          
          init:
              [mkdir] Created dir: /home/jbertram/Downloads/hornetq-2.2.14.Final/examples/jms/queue/build
              [mkdir] Created dir: /home/jbertram/Downloads/hornetq-2.2.14.Final/examples/jms/queue/build/classes
          
          
          compile:
               [echo] src.example.dir=/home/jbertram/Downloads/hornetq-2.2.14.Final/examples/jms/queue/src
              [javac] Compiling 6 source files to /home/jbertram/Downloads/hornetq-2.2.14.Final/examples/jms/queue/build/classes
          
          
          runExample:
               [java] serverProps = -XX:+UseParallelGC -Xms256M -Xmx256M -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Dcom.sun.management.jmxremote -Djava.util.logging.config.file=/home/jbertram/Downloads/hornetq-2.2.14.Final/examples/common/config/logging.properties -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces 
               [java] Aug 22, 2012 4:24:06 PM org.hornetq.common.example.HornetQExample run
               [java] INFO: hornetq.example.runServer is true
               [java] Aug 22, 2012 4:24:06 PM org.hornetq.common.example.HornetQExample startServer
               [java] INFO: starting server with config 'server0' logServerOutput true
               [java] HornetQServer_0 err:* [main] 22-Aug 16:24:7,212 INFO [HornetQServerImpl]  live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/largemessages,pagingDirectory=data/paging)
               [java] HornetQServer_0 err:
               [java] HornetQServer_0 err:* [main] 22-Aug 16:24:7,224 INFO [HornetQServerImpl]  Waiting to obtain live lock
               [java] HornetQServer_0 err:
               [java] HornetQServer_0 err:* [main] 22-Aug 16:24:7,253 INFO [JournalStorageManager]  Using AIO Journal
               [java] HornetQServer_0 err:
               [java] HornetQServer_0 err:* [main] 22-Aug 16:24:7,267 WARNING [HornetQServerImpl]  Security risk! It has been detected that the cluster admin user and password have not been changed from the installation default. Please see the HornetQ user guide, cluster chapter, for instructions on how to do this.
               [java] HornetQServer_0 err:
               [java] HornetQServer_0 err:* [main] 22-Aug 16:24:7,436 INFO [AIOFileLockNodeManager]  Waiting to obtain live lock
               [java] HornetQServer_0 err:
               [java] HornetQServer_0 err:* [main] 22-Aug 16:24:7,437 INFO [AIOFileLockNodeManager]  Live Server Obtained live lock
               [java] HornetQServer_0 err:
               [java] HornetQServer_0 err:* [main] 22-Aug 16:24:8,65 INFO [HornetQServerImpl]  trying to deploy queue jms.queue.exampleQueue
               [java] HornetQServer_0 err:
               [java] HornetQServer_0 err:* [main] 22-Aug 16:24:8,291 INFO [NettyAcceptor]  Started Netty Acceptor version 3.2.5.Final-a96d88c localhost:5445 for CORE protocol
               [java] HornetQServer_0 err:
               [java] HornetQServer_0 err:* [main] 22-Aug 16:24:8,292 INFO [HornetQServerImpl]  Server is now live
               [java] HornetQServer_0 err:
               [java] HornetQServer_0 err:* [main] 22-Aug 16:24:8,292 INFO [HornetQServerImpl]  HornetQ Server version 2.2.14.Final (HQ_2_2_14_FINAL, 122) [b4995bb6-ec9f-11e1-b3c0-2d68e6d65dfd]) started
               [java] HornetQServer_0 err:
               [java] HornetQServer_0 out:STARTED::
               [java] Aug 22, 2012 4:24:08 PM org.hornetq.common.example.HornetQExample getContext
               [java] INFO: using server0/client-jndi.properties for jndi
               [java] Sent message: This is a text message
               [java] Received message: This is a text message
               [java] example complete
               [java] 
               [java] #####################
               [java] ###    SUCCESS!   ###
               [java] #####################
          
          
          BUILD SUCCESSFUL
          Total time: 3 seconds
          jbertram@jbertram-laptop-510 ~/Downloads/hornetq-2.2.14.Final/examples/jms/queue $
          

           

          Perhaps you should try the latest non-alpha version (i.e. 2.2.14.Final).

          1 of 1 people found this helpful
          • 2. Re: Help.  I want to scream, trying to run examples.
            Justin Bertram Master

            One more thing...

             

            I see, "class file has wrong version 50.0, should be 49.0" which indicates you are using Java 5 rather than 6.  I realize that you said you tried both 5 and 6, but whatever you did to make it use 6 must not have worked.

            1 of 1 people found this helpful
            • 3. Re: Help.  I want to scream, trying to run examples.
              markorocko Newbie

              I get the same results with the latest version using windows, looks like you are using Unix.

              See below java -version 1.6.0_34, JAVA_HOME points to the same version.

              I still feel like screaming.  :    )

               

              C:\APIsAndSamples\HornetQ\hornetq-2.2.14.Final\examples\jms\queue>java -version

              java version "1.6.0_34"

              Java(TM) SE Runtime Environment (build 1.6.0_34-b04)

              Java HotSpot(TM) Client VM (build 20.9-b04, mixed mode, sharing)

               

              C:\APIsAndSamples\HornetQ\hornetq-2.2.14.Final\examples\jms\queue>build

              Build script found javac.

              hit alternate

              Using the following ant version from ..\..\..\tools\ant:

              calling ..\..\..\tools\ant\bin\ant.bat -version

              Apache Ant version 1.7.1 compiled on June 27 2008

              calling ..\..\..\tools\ant\bin\ant.bat  -Dhornetq.run_script=true

              Buildfile: build.xml

               

              run:

               

              init:

               

              compile:

                   [echo] src.example.dir=C:\APIsAndSamples\HornetQ\hornetq-2.2.14.Final\examples\jms\qu

              eue\src

                  [javac] Compiling 6 source files to C:\APIsAndSamples\HornetQ\hornetq-2.2.14.Final\exa

              mples\jms\queue\build\classes

                  [javac] C:\APIsAndSamples\HornetQ\hornetq-2.2.14.Final\examples\common\src\org\hornetq

              \common\example\SpawnedHornetQServer.java:16: cannot access org.hornetq.integration.bootst

              rap.HornetQBootstrapServer

                  [javac] bad class file: C:\APIsAndSamples\HornetQ\hornetq-2.2.14.Final\lib\hornetq-boo

              tstrap.jar(org/hornetq/integration/bootstrap/HornetQBootstrapServer.class)

                  [javac] class file has wrong version 50.0, should be 49.0

                  [javac] Please remove or make sure it appears in the correct subdirectory of the class

              path.

                  [javac] import org.hornetq.integration.bootstrap.HornetQBootstrapServer;

                  [javac]                                          ^

                  [javac] 1 error

               

              BUILD FAILED

              C:\APIsAndSamples\HornetQ\hornetq-2.2.14.Final\examples\jms\queue\build.xml:22: The follow

              ing error occurred while executing this line:

              C:\APIsAndSamples\HornetQ\hornetq-2.2.14.Final\examples\common\build.xml:127: Compile fail

              ed; see the compiler error output for details.

               

              Total time: 1 second

              Done

              • 4. Re: Help.  I want to scream, trying to run examples.
                Justin Bertram Master

                I had a relatively fresh Windows XP VM that didn't have Java installed so I downloaded HornetQ 2.2.14 and JDK 1.6.0_34_b04 and unzipped/installed both to folders directly on C:\ (i.e. not in "Program Files" because of how Windows/Java handles spaces in directory names).  Then I set JAVA_HOME and executed build.bat from the jms/queue example.  Everything worked fine.  I'm confident that your problem is with your environment and not with HornetQ.

                • 5. Re: Help.  I want to scream, trying to run examples.
                  markorocko Newbie

                  Me too.  JAVA_HOME=C:\jdk1.6.0_34

                  I even cleared out my PATH and put the jdk in alone with the same results.

                   

                  Any recommendations?  I'm at a loss!

                  • 6. Re: Help.  I want to scream, trying to run examples.
                    markorocko Newbie

                    That's why "I want to scream".   :       )

                    • 7. Re: Help.  I want to scream, trying to run examples.
                      Clebert Suconic Master

                      Maybe there's another javac in your PATH?

                       

                      I would check your path careful. It's an environmental issue with path there.

                      • 8. Re: Help.  I want to scream, trying to run examples.
                        markorocko Newbie

                        Here's my path:

                        Path=C:\jdk1.6.0_34\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Java\jdk1.5.0_22\jre\lib\ext\ojdbc14.jar;C:\Program Files\Symantec\pcAnywhere\;C:\JavaProjects\PowerJBoss6\powerlibs\jaxrpc-impl-1.1.3_01.jar;C:\apache-ant-1.8.4\bin;C:\apache-maven-3.0.4\bin

                        • 9. Re: Help.  I want to scream, trying to run examples.
                          markorocko Newbie

                          I even went to control panel and removed all the java plugins.

                          • 10. Re: Help.  I want to scream, trying to run examples.
                            Justin Bertram Master

                            I don't have any other recommendations except to get off Windows .

                             

                            Seriously though, I really haven't used Windows at all for Java development since 2008 so I can't think of what the underlying problem might be.  I'm sorry I can't help more.

                            • 11. Re: Help.  I want to scream, trying to run examples.
                              markorocko Newbie

                              Great Scott!!!! It works.

                              So, from the control panel, Java, I removed all instances - I had multiple for various app servers.

                              This didn't do nothing, same problem, and I had NO java references anywhere in my path except explicitely JDK1.60_33.

                              So I pretty much gave up but then got a wild hair to install C:\jdk1.6.0_34.

                              I did it and HornetQ now builds properly like Justin's.

                               

                              YES!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                              Thanks guys for all the assists.  I would have lost it much sooner without your generous contributions.

                               

                              I can't explain this, except to say perhaps when java installs to windows it does more than just follow the defined system paths but some how goes directly to the installation but I have no idea.

                              • 12. Re: Help.  I want to scream, trying to run examples.
                                Justin Bertram Master

                                I'm glad to hear your issue is resolved.