14 Replies Latest reply on Dec 13, 2011 1:00 PM by Dariusz P

    Problem SendJMSMessage

    Dariusz P Newbie

      Hi there.

      I have a problem with HelloWorld quickstart example. It simply doesn't work.  I am using jdk 1.6, Jboss ESB 4.9, Jboos AS 5.1.0 GA, adn Eclipse Helios with Jboss Tools. When i try to deploy HelloWorld to the server everything seems to be ok. I have to queues added. But when i try to run SendJMSMessage or SendESBMessage i have a problem like this :

       

      Exception in thread "main" javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]

      at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

      at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

      at javax.naming.InitialContext.init(Unknown Source)

      at javax.naming.InitialContext.<init>(Unknown Source)

      at org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage.setupConnection(SendJMSMessage.java:50)

      at org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage.main(SendJMSMessage.java:81)

      Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory

      at java.net.URLClassLoader$1.run(Unknown Source)

      at java.security.AccessController.doPrivileged(Native Method)

      at java.net.URLClassLoader.findClass(Unknown Source)

      at java.lang.ClassLoader.loadClass(Unknown Source)

      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

      at java.lang.ClassLoader.loadClass(Unknown Source)

      at java.lang.Class.forName0(Native Method)

      at java.lang.Class.forName(Unknown Source)

      at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)

      ... 6 more

       

      I don't have any idea what is the cause of the probelm. I tried to run this example on different servers but on JBoss AS 6 i have problem to deploy project. Also i've tried to run JBoss AS with Hornetq but i also have problems to deploy hello world. I have done everything like in tutorials. Also if i try to run examples using ant i've got the same problem. And i don't know what i'm doing wrong.

        • 1. Re: Problem SendJMSMessage
          Tom Cunningham Master

          Are you seeing this error in the server.log, or is this error in your Eclipse run log for SendJMSMessage?

          • 2. Re: Problem SendJMSMessage
            Dariusz P Newbie

            I have this error in my eclipse. In the server log i haven't got anything.

            • 3. Re: Problem SendJMSMessage
              Tom Cunningham Master

              Here's what you should be looking at then :

               

              Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory

               

              It looks like you are missing that class on your classpath - you should add jnp-client.jar to your runtime classpath.

              1 of 1 people found this helpful
              • 4. Re: Problem SendJMSMessage
                Dariusz P Newbie

                Ok now everything seems to be ok. But when I  run the SendJMSMessage. It opens the connection. And seems to work propertly. But i don't have any response on the server. In serwer log i have that my queues are added :

                 

                 

                19:59:26,761 INFO  [QueueService] Queue[/queue/quickstart_helloworld_Request_esb] started, fullSize=200000, pageSize=2000, downCacheSize=2000

                19:59:26,791 INFO  [QueueService] Queue[/queue/quickstart_helloworld_Request_gw] started, fullSize=200000, pageSize=2000, downCacheSize=2000

                 

                And my question is how can i find out what is going wrong ?? Or what may be the cause of the problem. I've added jbossesb-rosetta.jar the project.

                • 5. Re: Problem SendJMSMessage
                  Tom Cunningham Master

                  If you use the ant script instead of Eclipse ("ant runtest"), do you see the same results?

                  • 6. Re: Problem SendJMSMessage
                    Dariusz P Newbie

                    If I use ant scripts i dont see any results because I have java errors. I simply don't know where to copy necessary jar files or how to configure classpath with ant.

                     

                    And i have a question how i can configure my java/eclipse/system to automatically find necessary esb jars. Becouse at the moment i have to add every single necesary jar file to my project. And this is quite annoying.

                    And if we are talking about my problem. I have an ifformation in eclipse like that :

                     

                     

                    Description     Resource     Path     Location     Type

                    Classpath entry C:/Documents and Settings/dpitera/Desktop/esb/jbossesb-4.9/lib/jbossesb-rosetta.jar will not be exported or published. Runtime ClassNotFoundExceptions may result.

                     

                     

                    And i think that. SendJMSMessage works propertly. ESB also works ok. But when ESB tryies to invoke MyJMSListenerAction it don't have included jbossesb-rosseta.jar and simply nothing is happening. But for me i should have samoe error. But where? And the most important question. How to add jbossesb-rossetta.jar so it will be published to serwer in eclipse? Or I'am thinking wrong?

                    • 7. Re: Problem SendJMSMessage
                      Tom Cunningham Master

                      The ant scripts for the quickstarts should not have any java errors.      Start here :

                       

                      http://docs.jboss.org/jbossesb/docs/4.10/manuals/html/Getting_Started_Guide/index.html

                       

                      This will run you through setting up ESB with the ant scripts (as opposed to Eclipse).      Once you get that working and settled, you can reverse engineer the classpath if you need to.

                       

                      I'd also like to diagnose what's going on with your tools installation though -  what version of JBoss Tools are you using with Eclipse Helios?    Are you using a stable build or a nightly?  

                      • 8. Re: Problem SendJMSMessage
                        Dariusz P Newbie

                        Ok. Before i tried to work with Jboss tools i have problems with ant. If we are talkig about jboss tools i'am using Stable wersion.

                        http://download.jboss.org/jbosstools/updates/stable/helios/

                         

                        But when i am going through the Getting started guide i've also got a problem. Maybe i'am doing something wrong or i misunderstood something. I'am not a native speaker. I tried to install Jboss ESB 4.9 on a Jboss 5.1.0 GA and i have problems . Alsa i tried to run quickstarts on Jbossesb Server 4.9 But still norhing. I try to tell you what i'am doing and what errors i have.

                         

                        JBOSS ESB 4.9 + Jboss AS 5.1.0 GA

                         

                        I set deployment.roperties in my /install catalog. A runt ant and i have communicate BUILD Succesfull.

                        It seems to be easy and OK.

                        I check my server is up and running. (localhost:8080)

                        I check libs in server/lib/endorsed and it is ok.

                        I go to the samples/quickstarts/helloworld

                         

                        i run ant deploy and communcate : Build Successfull. But on the server log i havent got anything. No JMS queues.

                        And when i type ant runtest i have an error :

                         

                         

                        deploy:

                         

                        BUILD SUCCESSFUL

                        Total time: 13 seconds

                         

                        C:\ESB\jbossesb-4.9\samples\quickstarts\helloworld>ant runtest

                        Buildfile: C:\ESB\jbossesb-4.9\samples\quickstarts\helloworld\build.xml

                         

                        check-jbossesb-dist:

                         

                        qslib-dependencies:

                         

                        non-qslib-dependencies:

                         

                        jbossesb-quickstart-override:

                         

                        jbossesb-source-dependencies:

                         

                        jbossesb-server-dependencies:

                         

                        check-as-version:

                             [echo] C:\ESB\jbossesb-4.9\install\jboss-5.1.0.GA\server\default

                         

                        jbossesb-dependencies-as4:

                         

                        jbossesb-dependencies-as5:

                         

                        messaging-config:

                         

                        messaging-dependencies:

                         

                        jbossmq-dependencies:

                         

                        hornetq-dependencies:

                         

                        quickstart-specific-dependencies:

                         

                        classpath-dependencies-as4:

                         

                        classpath-dependencies-as5:

                         

                        quickstart-specific-checks:

                         

                        dependencies:

                         

                        compile:

                            [javac] C:\ESB\jbossesb-4.9\samples\quickstarts\conf\base-build.xml:435: war

                        ning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; se

                        t to false for repeatable builds

                            [javac] C:\ESB\jbossesb-4.9\samples\quickstarts\conf\base-build.xml:440: war

                        ning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; se

                        t to false for repeatable builds

                         

                        runtest:

                             [echo] Runs Test JMS Sender

                             [java] Exception in thread "main" javax.naming.NameNotFoundException: quick

                        start_helloworld_Request_gw not bound

                             [java]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)

                         

                             [java]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)

                         

                             [java]     at org.jnp.server.NamingServer.getObject(NamingServer.java:785)

                             [java]     at org.jnp.server.NamingServer.lookup(NamingServer.java:443)

                             [java]     at org.jnp.server.NamingServer.lookup(NamingServer.java:399)

                             [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                             [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces

                        sorImpl.java:39)

                             [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet

                        hodAccessorImpl.java:25)

                             [java]     at java.lang.reflect.Method.invoke(Method.java:597)

                             [java]     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.jav

                        a:305)

                             [java]     at sun.rmi.transport.Transport$1.run(Transport.java:159)

                             [java]     at java.security.AccessController.doPrivileged(Native Method)

                             [java]     at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

                             [java]     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspor

                        t.java:535)

                             [java]     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCP

                        Transport.java:790)

                             [java]     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPT

                        ransport.java:649)

                             [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Thread

                        PoolExecutor.java:886)

                             [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool

                        Executor.java:908)

                             [java]     at java.lang.Thread.run(Thread.java:662)

                             [java]     at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServe

                        r(StreamRemoteCall.java:255)

                             [java]     at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCa

                        ll.java:233)

                             [java]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)

                             [java]     at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)

                             [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:72

                        6)

                             [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:68

                        6)

                             [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)

                             [java]     at org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSM

                        essage.setupConnection(SendJMSMessage.java:55)

                             [java]     at org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSM

                        essage.main(SendJMSMessage.java:81)

                         

                        BUILD FAILED

                        C:\ESB\jbossesb-4.9\samples\quickstarts\helloworld\build.xml:14: Java returned:

                        1

                         

                        Total time: 18 seconds

                         

                        C:\ESB\jbossesb-4.9\samples\quickstarts\helloworld>

                         

                         

                        On server Side i have a message :

                         

                        10:26:55,432 WARN  [SimpleConnectionManager] A problem has been detected with th

                        e connection to remote client 4p726l1y-mry9zn-gvw4v8jx-1-gvw4vbea-4, jmsClientID

                        =b-4lcv4wvg-1-xj8v4wvg-nz9yrm-y1l627p4. It is possible the client has exited wit

                        hout closing its connection(s) or the network has failed. All associated connect

                        ion resources will be cleaned up.

                        And i still have no idea what i could possibly do wrong. Or what is a problem. So i tried on JBoss ESB server 4.9

                         

                        JbossESB Server 4.9

                         

                        I run in my sapmles/quickstart/helloworld

                         

                        ant build -> Build Succesfull

                        ant runtest -> Succesfull

                         

                        But on server When i Build i have a message :

                         

                         

                         

                        10:36:03,239 INFO  [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBos

                        s_4_2_3_GA date=200807181417)] Started in 2m:20s:862ms

                        10:36:26,273 INFO  [JBoss4ESBDeployer] create esb service, Quickstart_helloworld

                        _action.esb

                        10:36:26,333 INFO  [QueueService] Queue[/queue/quickstart_helloworld_action_Requ

                        est] started, fullSize=200000, pageSize=2000, downCacheSize=2000

                        10:36:26,343 INFO  [QueueService] Queue[/queue/quickstart_helloworld_action_Resp

                        onse] started, fullSize=200000, pageSize=2000, downCacheSize=2000

                        10:36:26,353 INFO  [QueueService] Queue[/queue/quickstart_helloworld_action_esb]

                        started, fullSize=200000, pageSize=2000, downCacheSize=2000

                        10:36:26,393 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

                         

                        --- MBeans waiting for other MBeans ---

                        ObjectName: jboss.esb:service=JuddiRMI

                          State: FAILED

                          Reason: java.lang.ExceptionInInitializerError

                          I Depend On:

                            jboss.esb:service=JUDDIDatabaseInitializer

                            jboss.esb:service=PropertyService

                          Depends On Me:

                            jboss.esb:service=JuddiClient

                         

                        --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---

                        ObjectName: jboss.esb:service=JuddiRMI

                          State: FAILED

                          Reason: java.lang.ExceptionInInitializerError

                          I Depend On:

                            jboss.esb:service=JUDDIDatabaseInitializer

                            jboss.esb:service=PropertyService

                          Depends On Me:

                            jboss.esb:service=JuddiClient

                         

                         

                          

                        And nothing Happens. I havent got any error. In my ant scripts. But i think i should have. If you have any ideas what is the problem i would be gratefull. I try to run it for over a week. And norhing. I try to use different Jboss AS and different wersions of Jboss ESB. If this would be helpfull i'm using Win XP on Virtual PC. 

                        • 9. Re: Problem SendJMSMessage
                          Tom Cunningham Master

                          I noticed you are using JDK 1.6 and jboss 5.1.0.GA - are you using the JDK1.6 version of jboss 5.1.0.GA?

                           

                          http://sourceforge.net/projects/jboss/files/JBoss/JBoss-5.1.0.GA/

                          • 10. Re: Problem SendJMSMessage
                            Dariusz P Newbie

                            I try again with JDK 1.6 version of Jboss AS 1.6.0.GA and i still have the same problem when i use ant runtest I've got errors posted above.  Have you got any ideas??

                             

                            For me most weird thing is that when i type ant deploy i have message Build Successfull. Nothing realy happens. And in my Jboss server I haven't got quickstart_helloworld_Request_gw JMS queue. So if i try to run "ant runtest" it can't find destination queue so i have that error. But I can be wrong. But what i can be doing wrong ?? Or what i need to do more ??

                            • 11. Re: Problem SendJMSMessage
                              Tom Cunningham Master

                              Here is the output I see when I deploy :

                               

                              https://gist.github.com/1451934

                               

                              I'm a little confused because your server is trying to deploy Quickstart_helloworld_action.esb and you are here :

                               

                              C:\ESB\jbossesb-4.9\samples\quickstarts\helloworld>ant runtest

                               

                              helloworld and helloworld_action are different quickstarts.

                              • 12. Re: Problem SendJMSMessage
                                Dariusz P Newbie

                                Ok when i type ant deploy i have the same output. But problem is when i try to runtest ;/

                                I know that quickstart_helloworld_action is a different sample. I was trying to check if other quickstarts run propertly. And i must copy a wrong output. It's my mistake. But what could be the cause of the problem when i try "ant runtest" ??

                                • 13. Re: Problem SendJMSMessage
                                  Tom Cunningham Master

                                  Dariusz, the problem looks like that helloworld ESB was not deployed at the point that you tried to execute runtest.   Did you wait for the server to deploy before executing runtest?   

                                   

                                  The server problem you posted I'm not sure about - I'd have to see the complete server log - post it to a pastebin site and give us the link or attach it here, and it'd probably be better if you started with a clean 5.1.0-JDK6 server + ESB.

                                  • 14. Re: Problem SendJMSMessage
                                    Dariusz P Newbie

                                    Ok. I solved the problem with my ant runtest. I'm usung windows. And i have wrong path in my enviromental variable for JBOSS_HOME, ant when i test ant deploy everything was ok. But nothing was happening. And when i try to ant runtest i have this error because it couldn't find destination. Today i will try with my eclipse.

                                     

                                    Ok now it is working fine. Without any problems. When i run eclipse i was even shocked it run so easly. Great thanks for help Tom.