7 Replies Latest reply on Mar 31, 2011 4:06 AM by lenolee

    HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9

    uestc

      the full error is as  follow

       

      17:48:23,046 INFO  [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)] Started in 55s:718ms
      17:49:01,312 WARN  [BisocketClientInvoker] Unable to send ping: shutting down PingTimerTask
      java.net.SocketException: Connection reset by peer: socket write error
          at java.net.SocketOutputStream.socketWrite0(Native Method)
          at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
          at java.net.SocketOutputStream.write(SocketOutputStream.java:115)
          at org.jboss.remoting.transport.bisocket.BisocketClientInvoker$PingTimerTask.run(BisocketClientInvoker.java:726)
          at java.util.TimerThread.mainLoop(Timer.java:512)
          at java.util.TimerThread.run(Timer.java:462)

      I  have install the jboss ESB Server4.9 and Eclipse3.6.1.in the path   jboss ESB Server4.9/samples/quickstarts I run the helloworld example  successfully

      but when I copy the src code into a project I set up in the eclipse .the steps are all following the page:"http://www.mastertheboss.com/soa-a-esb/78-jboss-esb.html",all is OK but at last I encouter the problems .

       

      Unable to send ping: shutting down PingTimerTask
      java.net.SocketException: Connection reset by peer: socket write error

      does anyone who can help me ?or give me some tips ?

      is this the problem of version of the jboss messaging client jar ?

        • 1. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
          kconner

          The warning comes from the underlying remoting codebase used by messaging and is harmless.  It is caused when the messaging client stops without cleanly closing its resources, this is the server letting you know that it has recognised this.

          • 2. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
            uestc

            as you said,I think my jar file configuration of the project is OK?

            • 3. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
              kconner

              The jar will be fine, you just need to close the connection in your client.

              • 4. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
                uestc

                the code is just as belows

                public class SendJMSMessage {
                    QueueConnection conn;
                    QueueSession session;
                    Queue que;
                   
                   
                    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");
                    }
                   
                    public void stop() throws JMSException
                    {
                        conn.stop();
                        session.close();
                        conn.close();
                    }
                   
                    public void sendAMessage(String msg) throws JMSException {
                       
                        QueueSender send = session.createSender(que);       
                        ObjectMessage tm = session.createObjectMessage(msg);
                       
                        send.send(tm);       
                        send.close();
                    }
                      
                   
                    public static void main(String args[]) throws Exception
                    {                   
                        SendJMSMessage sm = new SendJMSMessage();
                        sm.setupConnection();
                       
                        sm.sendAMessage(args[0]);
                       sm.stop();
                       
                    }
                   
                }

                 

                 

                you said I need to close the connection but there are code

                       sm.stop();

                what should I do?

                 

                Kevin Conner 编写:

                 

                The jar will be fine, you just need to close the connection in your client.

                • 5. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
                  kconner

                  That code looks like it is from the helloworld quickstart and should be fine, assuming it completes normally.  If you were to remove the following line then you would also see this issue in that quickstart.

                  conn.close();
                  • 6. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
                    uestc

                    yeah the code is from the sample quickstart,what I wonder is that why the same  code  get the different result in the command line and the eclipse IDE?

                    • 7. HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
                      lenolee

                      I have the same problem,that confused me a long time.And the code conn.close(); exists.

                      Can anyone give me some help???