1 2 Previous Next 16 Replies Latest reply on Aug 31, 2008 12:27 PM by beve

    Still Hello World error

    vishal12345

      Hello
      Can anyone please figure out what error is this i m deploying hello world and now i get this error where as it seemed to be working yersterday

      pleasee...
      I am using JBOSSESB server and running JMS test message program

      01:35:18,109 INFO [STDOUT] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      01:35:18,109 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ To: JMSEpr [ PortReference < <wsa:Address jms://127.0.0.1:1099/queue/eclipse_quickstart_helloworld_Request_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : jnp://127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jboss.naming:org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 7153a7ac-4266-441e-a096-acdf45afd0fb RelatesTo: jms:correlationID#7153a7ac-4266-441e-a096-acdf45afd0fb ]
      java.lang.NullPointerException
      at java.lang.String.(Unknown Source)
      at org.jboss.soa.esb.samples.quickstart.helloworld.MyJMSListenerAction.displayMessage(MyJMSListenerAction.java:38)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processMethods(ActionProcessorMethodInfo.java:102)
      at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.process(OverriddenActionLifecycleProcessor.java:74)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
      at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:530)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      01:35:18,109 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: JMSEpr [ PortReference < <wsa:Address jms://127.0.0.1:1099/queue/eclipse_quickstart_helloworld_Request_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : jnp://127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jboss.naming:org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 7153a7ac-4266-441e-a096-acdf45afd0fb RelatesTo: jms:correlationID#7153a7ac-4266-441e-a096-acdf45afd0fb

        • 1. Re: Still Hello World error
          vishal12345

          Has any body got the solution please ?

          • 2. Re: Still Hello World error
            tcunning

            java.lang.NullPointerException
            at java.lang.String.(Unknown Source)
            at org.jboss.soa.esb.samples.quickstart.helloworld.MyJMSListenerAction.displayMessage(MyJMSListenerAction.java:38)

            It looks like maybe the message you are sending has a null body. Are you using the default SendJMSMessage class that goes along with the HelloWorld quickstart?

            • 3. Re: Still Hello World error
              vishal12345

              yes i am using the default sendJMSMessage Class

              • 4. Re: Still Hello World error
                vishal12345

                hey guys i solved it finally but still thanks for considering this post

                here is the solution

                Modify the MyJMSActionListener displayMessage Function as follows

                System.out.println("Body: " +message.getBody().get());

                the getBytes() function is depricated anyway so might be that is the main culprit was restricting it from working i guess these examples are fairly old.

                anyways

                Thanks

                • 5. Re: Still Hello World error

                  Hi,

                  I have a similar error, just after the "helloworld" and "helloworld_action" have been deployed and the "ant runtest" runs. It seems the JMS connects to my localhost or 127.0.0.1, even though I started my JBOSS 4.2.2 GA Application Server with the command "run.sh -b server.domain.com". The ESB seems correctly deployed in the JBOSS and the application server correctly respond to the server.domain.com:8081.
                  Error description during "ant runtest":
                  ===================================================================
                  compile:

                  runtest:
                  [echo] Runs Test JMS Sender
                  [java] 18:38:02,372 DEBUG [main][NamingContext] Failed to connect to localhost:1099
                  [java] javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
                  [java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
                  [java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
                  [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
                  [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
                  [java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
                  [java] at org.jboss.soa.esb.samples.quickstart.helloworldaction.test.SendJMSMessage.setupConnection(SendJMSMessage.java:44) [java] at org.jboss.soa.esb.samples.quickstart.helloworldaction.test.SendJMSMessage.main(SendJMSMessage.java:73)
                  [java] Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
                  [java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:243)
                  [java] ... 6 more
                  [java] Caused by: java.net.ConnectException: Connection refused
                  [java] at java.net.PlainSocketImpl.socketConnect(Native Method)
                  [java] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
                  [java] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
                  [java] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
                  [java] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
                  [java] at java.net.Socket.connect(Socket.java:519)
                  [java] at java.net.Socket.connect(Socket.java:469)
                  [java] at java.net.Socket.(Socket.java:366)
                  [java] at java.net.Socket.(Socket.java:266)
                  [java] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
                  [java] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
                  [java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239)
                  [java] ... 6 more
                  [java] Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]]
                  [java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
                  [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
                  [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
                  [java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
                  [java] at org.jboss.soa.esb.samples.quickstart.helloworldaction.test.SendJMSMessage.setupConnection(SendJMSMessage.java:44) [java] at org.jboss.soa.esb.samples.quickstart.helloworldaction.test.SendJMSMessage.main(SendJMSMessage.java:73)
                  [java] Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
                  [java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
                  [java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
                  [java] ... 5 more
                  [java] Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
                  [java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:243)
                  [java] ... 6 more
                  [java] Caused by: java.net.ConnectException: Connection refused
                  [java] at java.net.PlainSocketImpl.socketConnect(Native Method)
                  [java] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
                  [java] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
                  [java] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
                  [java] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
                  [java] at java.net.Socket.connect(Socket.java:519)
                  [java] at java.net.Socket.connect(Socket.java:469)
                  [java] at java.net.Socket.(Socket.java:366)
                  [java] at java.net.Socket.(Socket.java:266)
                  [java] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
                  [java] at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
                  [java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239)
                  [java] ... 6 more

                  BUILD FAILED
                  /usr/local/soa/jbossesb-4.4.GA/samples/quickstarts/helloworld_action/build.xml:14: Java returned: 1

                  Total time: 9 seconds
                  =========================================================
                  Any idea about what the problem might be? MY /etc/hosts correctly have localhost associated to my server.domain.com. So, I don't think there is a name resolution problem.
                  Thanks.
                  Sal

                  • 6. Re: Still Hello World error
                    beve

                    Take a look at SendJMSMessage in the helloworld quickstart to see how it looks up the queue.

                    Regards,

                    /Daniel

                    • 7. Re: Still Hello World error
                      vishal12345

                      thanks daniel i have solved this long back but thanks for the support you guys rock at jboss.org

                      • 8. Re: Still Hello World error

                        Thanks Daniel,
                        I think your reply was directed to me.
                        I guess you are referring to the string I see in the build.xml file, which states:

                        Has this error something to do with the request_gw? Where does it look for this information?
                        Thanks.
                        Salvo

                        • 9. Re: Still Hello World error

                          I don't see the string I pasted.
                          =============================================

                          ============================================
                          Salvo

                          • 10. Re: Still Hello World error

                            OK. There is something in the Forum software. I see the string in the preview and it disappears after "submit".
                            target name="runtest" depends="compile"
                            description="sends a JMS message to queue/quickstart_helloworld_
                            Request_gw"

                            • 11. Re: Still Hello World error
                              beve

                              Hi ilasa01,

                              I was thinking about that you stated that you are starting you server with -b. If you look in SendJMSMessage you will find:

                              Properties properties1 = new Properties();
                               properties1.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                               properties1.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
                               properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
                               InitialContext iniCtx = new InitialContext(properties1);


                              So you would need to modify the provider url to match the hostname/ip that you used with the -b flag when starting the server.

                              Regards,

                              /Daniel

                              • 12. Re: Still Hello World error

                                Hi Daniel,

                                I am new with the Jboss ESB package and I might ask silly questions, apologies. I guess you are right and I have been somehow looking for the SendJMSMessage URL_PKG_Prefixes and Provider_URL in several .properties files of the JBOSS ESB 4.4 GA but unable to find the relevant entry. Yes, you are right the JMS perhaps is going to the default 127.0.0.1 instead of my server TCP-IP address. Do you mind to write me where I should look at the code you mentioned? The /sample/quickstarts/helloworld folder doesn't seem to have the code in any of its files.

                                Thanks.
                                Salvo

                                • 13. Re: Still Hello World error

                                  my /samples/quickstarts/helloworld/jboss-esb.xml content:

                                  <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">

                                  <jms-bus busid="quickstartGwChannel">
                                  <jms-message-filter
                                  dest-type="QUEUE"
                                  dest-name="queue/quickstart_helloworld_Request_gw"
                                  />
                                  </jms-bus>
                                  <jms-bus busid="quickstartEsbChannel">
                                  <jms-message-filter
                                  dest-type="QUEUE"
                                  dest-name="queue/quickstart_helloworld_Request_esb"
                                  />
                                  </jms-bus>

                                  </jms-provider>

                                  Salvo

                                  • 14. Re: Still Hello World error
                                    beve

                                    Hi Salvo,

                                    the code that you need to look at is in:

                                    quickstarts/helloworld/src/org/jboss/soa/esb/samples/quickstart/helloworld/test/SendJMSMessage.java


                                    The code I mentioned is in the following method:
                                    public void setupConnection() throws JMSException, NamingException
                                     {
                                     Properties properties1 = new Properties();
                                     properties1.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                                     properties1.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
                                     properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
                                     InitialContext iniCtx = new InitialContext(properties1);
                                    
                                     Object tmp = iniCtx.lookup("ConnectionFactory");
                                     QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
                                     conn = qcf.createQueueConnection();
                                     que = (Queue) iniCtx.lookup("queue/quickstart_helloworld_Request_gw");
                                     session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
                                     conn.start();
                                     System.out.println("Connection Started");
                                     }

                                    You will need to change value for Context.PROVIDER_URL.

                                    Regards,

                                    /Daniel


                                    1 2 Previous Next