1 Reply Latest reply on Nov 12, 2007 3:28 AM by ron_sigal

    Cat not catch excption when jboss as is down - remote servic

    tony9427

      Application environment: JBoss Application Server 4.2.1, JBoss Messaging 1.3.0

      THere is a standalone application to receive jms in a while loop

      When Jboss server is up, the application runs well.
      But When I shutdown the JBoss server and restart it, the application can not run

      Part of the code: I want to re-connect JBoss Message when JBoss is down
      But it seems the application willl never go to #10 even JBoss is shut down.

       boolean reConnect = false;
      #1 while (true){
      #2 try{
      #3 if(reConnect){ // Try to connect JBoss Connection again
      #4 sf = new ServiceFactory(ic,"/ConnectionFactory");
      #5 reConnect = false;
      #6 }
      #7 String message = receiver.receive(1000);
      #8 }catch(Exception e){
      #9 // No exception is catched
      #10 System.out.println("exception");
      #11 reConnect = true;
      #12 }
      #13}
      



      How can I make the application running when jboss is restarted?

      Some log information is detected:
      2007-10-26 17:34:52,633 ERROR [org.jboss.remoting.transport.bisocket.BisocketServerInvoker] unable to get secondary locator
      org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [bisocket://192.168.164.172:4457/?clientMaxPoolSize=50&clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=1&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:530)
       at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:353)
       at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
       at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.getSecondaryLocator(BisocketClientInvoker.java:441)
       at org.jboss.remoting.transport.bisocket.BisocketServerInvoker.createControlConnection(BisocketServerInvoker.java:204)
       at org.jboss.remoting.transport.bisocket.BisocketServerInvoker$1.run(BisocketServerInvoker.java:949)
      Caused by: java.net.ConnectException: Connection refused: connect
       at java.net.PlainSocketImpl.socketConnect(Native Method)
       at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
       at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
       at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
       at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
       at java.net.Socket.connect(Socket.java:507)
       at org.jboss.remoting.transport.socket.SocketClientInvoker.createSocket(SocketClientInvoker.java:187)
       at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.createSocket(BisocketClientInvoker.java:360)
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:801)
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:526)
       ... 5 more
      2007-10-26 17:34:52,633 ERROR [org.jboss.remoting.transport.bisocket.BisocketServerInvoker] Unable to recreate control connection: InvokerLocator [null://192.168.164.172:3892/null]
      java.io.IOException: unable to get secondary locator: Can not get connection to server. Problem establishing socket connection for InvokerLocator [bisocket://192.168.164.172:4457/?clientMaxPoolSize=50&clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=1&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]
       at org.jboss.remoting.transport.bisocket.BisocketServerInvoker.createControlConnection(BisocketServerInvoker.java:209)
       at org.jboss.remoting.transport.bisocket.BisocketServerInvoker$1.run(BisocketServerInvoker.java:949)
      2007-10-26 17:34:58,551 WARN [org.jboss.remoting.LeasePinger] LeasePinger[SocketClientInvoker[12789d2, bisocket://192.168.164.172:4457](5c4o4k4s-3b4bn5-f88ic34s-1-f88ic3ta-5)] failed to ping to server: Can not get connection to server. Problem establishing socket connection for InvokerLocator [bisocket://192.168.164.172:4457/?clientMaxPoolSize=50&clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=1&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]


      Thanks in advance

        • 1. Re: Cat not catch excption when jboss as is down - remote se
          ron_sigal

          Could you check the version of jboss-remoting.jar in server/default/lib of your JBoss Application Server installation. [Substitute your configuration for "default".] An easy way to find the version is to run the jar:

          java -jar jboss-remoting.jar
          


          This sounds like a problem that existed in earlier versions of the bisocket transport, but which has since been fixed.