3 Replies Latest reply on May 10, 2004 1:52 PM by adrian.brock

    JBossMQ Error under heavy burden

      I use JBuilderX. It has a wizard which can generate a class encapsulate the JMS service. The class implements MessageListener. Anyone who has JBuilderX can have a try. Use the wizard to generate the class without any Transaction or Persistance. Let's take topic as an example.
      if we just
      while(true){
      [TheClassGenerated] jmsService=new [TheClassGenerated]();//hard code parameters inside the class
      jmsService.publishObject(new String("this is a demo");
      jmsService.close();
      }//the jndi inside should be modified

      This would surely generate Exception
      org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (jav
      a.net.BindException: Address already in use: connect)
      at org.jboss.mq.Connection.authenticate(Connection.java:883)
      at org.jboss.mq.Connection.(Connection.java:238)
      at org.jboss.mq.Connection.(Connection.java:315)
      at org.jboss.mq.SpyConnection.(SpyConnection.java:60)
      at org.jboss.mq.SpyConnectionFactory.createTopicConnection(SpyConnection
      Factory.java:78)
      at sgipwrapper.core.MsgTransfer.getTopicConnection(MsgTransfer.java:95)
      at sgipwrapper.core.MsgTransfer.getTopicSession(MsgTransfer.java:87)
      at sgipwrapper.core.MsgTransfer.publishObject(MsgTransfer.java:216)
      at sgipwrapper.core.callback.EvtDeliverCallBack.hook(EvtDeliverCallBack.
      java:53)
      at com.caimao.spapi.core.op.recv.recving(recv.java:163)
      at com.caimao.spapi.core.op.recv$2.run(recv.java:53)
      at com.caimao.spapi.core.op.recv$1.run(recv.java:22)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: java.net.BindException: Address already in use: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
      at java.net.Socket.connect(Socket.java:452)
      at java.net.Socket.connect(Socket.java:402)
      at java.net.Socket.(Socket.java:309)
      at java.net.Socket.(Socket.java:153)
      at javax.net.DefaultSocketFactory.createSocket(DashoA6275)
      at org.jboss.mq.il.oil.OILServerIL.createConnection(OILServerIL.java:563
      )
      at org.jboss.mq.il.oil.OILServerIL.checkConnection(OILServerIL.java:507)

      at org.jboss.mq.il.oil.OILServerIL.authenticate(OILServerIL.java:289)
      at org.jboss.mq.Connection.authenticate(Connection.java:876)
      ... 12 more

        • 1. Re: JBossMQ Error under heavy burden

          It means your OS is trying to reuse an anonymous client socket.

          This is a known problem on windows which by default doesn't allocate
          very many anonymous sockets (this has been discussed before in these
          forums and on the jboss-user mailing list if you want more details).

          You should check you are closing your connections properly unless you are
          trying to use lots of connections on purpose.

          • 2. Re: JBossMQ Error under heavy burden

            My code is very simple. And the close() is in finally clause. I can't see any means to improve my code to solve the problem:
            MsgTransfer jmsService= new MsgTransfer();
            try{
            jmsService.publishObject(obj);
            }catch(Exception ex){
            ex.printStackTrace();
            }finally{
            try{
            jmsService.close();
            }catch(Exception ex){
            ex.printStackTrace();
            }
            }

            • 3. Re: JBossMQ Error under heavy burden

              Your code is irrelevent:

              a) It shows no jboss code
              b) Your problem is in the network/os config not the code