12 Replies Latest reply on Sep 18, 2002 6:14 AM by Alwyn Schoeman

    Intermittent "Cannot connect to the ConnectionReceiver/Serve

    Sebastian Hallensleben Newbie

      Hi,

      I have problems getting JMS/JBossMQ to run reliably on Windows 98. Every now and then, sending a message results in the following error msg in the JBoss console window:

      JBoss 2.4.3 / Tomcat
      [OILClientIL] ConnectionReceiverOILClient is connecting to: 164.48.14.69:1438
      [ClientConsumer:ID1] Could not send messages to a receiver.
      java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server
      at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:98)

      at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:84)
      at org.jboss.mq.il.oil.OILClientIL.receive(OILClientIL.java:69)
      at org.jboss.mq.server.ClientConsumer.run(ClientConsumer.java:212)
      at java.lang.Thread.run(Thread.java:484)
      [JMSServer] The connection to client ID1 failed.

      The message sending code does not throw any exceptions itself, but no messages are received (receiving code runs separately). The strange thing is that sometimes everything works fine, under seemingly the same conditions.

      I have had some success getting the error to occur less frequently by uncommenting the following lines in jboss.properties:

      java.rmi.server.useLocalHostName=true
      java.rmi.server.hostname=localhost
      java.rmi.server.codebase=http://localhost:8080/

      I am running JBoss 2.4.3 / Tomcat 3.2.3 with JDK 1.3.1_01.

      Any help would be greatly appreciated.

        • 1. Re: Intermittent
          Sebastian Hallensleben Newbie

          To expand on my original message, here are some further observations which might help find the problem:

          (1) Running the example 1, chapter 4, in the JBoss documentation seems to work 100% of the time (previously, I used code based on Sun's JMS tutorial - the main difference is asynchronous vs. synchronous receive, and send/receive in the same process vs. separate processes). It still works after modifying it to send a thousand messages a quickly as possible.

          (2) When I turn this working piece of code into an HttpServlet, it sometimes works, but sometimes throws an exception "org.jboss.mq.SpyJMSException: Cannot start a the client IL service" on the server console. The error occurs when calling createQueueConnection(), and it happens regardless whether this call is in the servlet's init() or doGet() method.

          (3) When I create a servlet that does nothing but call the original working code (1), i.e. just calls org.jboss.chap5.example.SendRecvClient.main(), the same exception is thrown, but less frequently.

          (4) It seems that I can reduce the frequency even more by synchronizing org.jboss.chap5.example.SendRecvClient.main().

          (5) After an error has occurred for the first time, it becomes more and more likely to occur again, i.e. it seems like some resources are not cleaned up until the server is shutdown.

          Here is a stack trace of the exception (note that this is different from my first message):

          [Default] Begin sendRecvAsync
          [JMSServer] JMSServer->connectionClosing(dc=null)
          [SpyConnectionFactoryObjectFactory] SpyConnectionFactoryObjectFactory->getObjectInstance()
          [Connection] Connection Initializing
          [Connection] Getting the serverIL
          [Connection] Authenticating
          [Connection] Starting the clientIL service
          [Connection] java.net.SocketException: listen failed (code=10055)
          [Default] org.jboss.mq.SpyJMSException: Cannot start a the client IL service
          [Default] at org.jboss.mq.Connection.startILService(Connection.java:428)
          [Default]
          [Default] at org.jboss.mq.Connection.(Connection.java:119)
          [Default]
          [Default] at org.jboss.mq.Connection.(Connection.java:135)
          [Default]
          [Default] at org.jboss.mq.SpyConnection.(SpyConnection.java:58)
          [Default]
          [Default] at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:91)
          [Default]
          [Default] at org.jboss.chap5.example.SendRecvClient.setupPTP(SendRecvClient.java:55)
          [Default]
          [Default] at org.jboss.chap5.example.SendRecvClient.sendRecvAsync(SendRecvClient.java:66)
          [Default]
          [Default] at org.jboss.chap5.example.SendRecvClient.main(SendRecvClient.java:94)
          [Default]
          [Default] at dmsystem.testjms.SendRecvClient.doGet(SendRecvClient.java:110)
          [Default]
          [Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
          [Default]
          [Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          [Default]
          [Default] at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
          [Default]
          [Default] at org.apache.tomcat.core.Handler.service(Handler.java:287)
          [Default]
          [Default] at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
          [Default]
          [Default] at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
          [Default]
          [Default] at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
          [Default]
          [Default] at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
          [Default]
          [Default] at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
          [Default]
          [Default] at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
          [Default]
          [Default] at java.lang.Thread.run(Thread.java:484)
          [Default]
          [Default] linked exception is:
          [Default] java.net.SocketException: listen failed (code=10055)
          [Default] at java.net.PlainSocketImpl.socketListen(Native Method)
          [Default]
          [Default] at java.net.PlainSocketImpl.listen(PlainSocketImpl.java:413)
          [Default]
          [Default] at java.net.ServerSocket.(ServerSocket.java:171)
          [Default]
          [Default] at java.net.ServerSocket.(ServerSocket.java:82)
          [Default]
          [Default] at org.jboss.mq.il.oil.OILClientILService.init(OILClientILService.java:225)
          [Default]
          [Default] at org.jboss.mq.GenericConnectionFactory.createClientILService(GenericConnectionFactory.java:69)
          [Default]
          [Default] at org.jboss.mq.Connection.startILService(Connection.java:421)
          [Default]
          [Default] at org.jboss.mq.Connection.(Connection.java:119)
          [Default]
          [Default] at org.jboss.mq.Connection.(Connection.java:135)
          [Default]
          [Default] at org.jboss.mq.SpyConnection.(SpyConnection.java:58)
          [Default]
          [Default] at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:91)
          [Default]
          [Default] at org.jboss.chap5.example.SendRecvClient.setupPTP(SendRecvClient.java:55)
          [Default]
          [Default] at org.jboss.chap5.example.SendRecvClient.sendRecvAsync(SendRecvClient.java:66)
          [Default]
          [Default] at org.jboss.chap5.example.SendRecvClient.main(SendRecvClient.java:94)
          [Default]
          [Default] at dmsystem.testjms.SendRecvClient.doGet(SendRecvClient.java:110)
          [Default]
          [Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
          [Default]
          [Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          [Default]
          [Default] at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
          [Default]
          [Default] at org.apache.tomcat.core.Handler.service(Handler.java:287)
          [Default]
          [Default] at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
          [Default]
          [Default] at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
          [Default]
          [Default] at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
          [Default]
          [Default] at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
          [Default]
          [Default] at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
          [Default]
          [Default] at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
          [Default]
          [Default] at java.lang.Thread.run(Thread.java:484)
          [Default]
          [JMSServer] JMSServer->connectionClosing(dc=null)


          I am fairly experienced with Java and servlets but new to JMS and JBoss - and rather puzzled by this. Anyone with ideas?

          • 2. Re: Intermittent
            Hiram Chirino Expert

            Seems like the system the client is on is giving us problems creating server sockets. I would recomend using the UIL connection factories since they do not create open clients side sockets.

            Regards,
            Hiram

            • 3. Re: Intermittent
              Sebastian Hallensleben Newbie

              Thanks a lot - this seems to have solved the unreliability problem. Unfortunately, however, performance has suffered dramatically:

              With QueueConnectionFactory (uses OIL as far as I can see from the documentation):
              300 messages / second
              With UILConnectionFactory:
              1 message per second (!)

              Is this the price to pay, or am I missing something? All I have changed in the code is replacing

              Object tmp = iniCtx.lookup("ConnectionFactory");
              QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
              by
              Object tmp = iniCtx.lookup("UILConnectionFactory");
              QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;

              Do I need to do anything else to switch from OIL to UIL? Also, closing the connection now results in the following error (following is snippet from server.log):

              [Default] ### About to call conn.stop()
              [Connection] Stoping connection, ClientID=ID3
              [ClientConsumer:ID3] ClientConsumer:ID3->setEnabled(enabled=false)
              [Default] ### About to call session.close()
              [Connection] Connection: removeSession(dest=QUEUE.testQueue)
              [JMSServer] Server: unsubscribe(idConnection=ID3)
              [ClientConsumer:ID3] ClientConsumer:ID3->removeSubscription(subscriberId=-2147483648)
              [Default] ### About to call conn.close()
              [Connection] Closing sessions, ClientID=ID3
              [Connection] Closed sessions
              [Connection] Disconnecting from server
              [JMSServer] JMSServer->connectionClosing(dc=SpyDistributedConnection:ID3)
              [ClientConsumer:ID3] ClientConsumer:ID3->close()
              [Connection] java.net.SocketException: Connection reset by peer: socket write error
              [Connection] JBossMQ Connection failure:
              org.jboss.mq.SpyJMSException: Error whle closing UILClientIL connection
              at org.jboss.mq.Connection.asynchFailure(Connection.java:350)
              at org.jboss.mq.il.uil.UILClientILService.run(UILClientILService.java:183)
              at java.lang.Thread.run(Thread.java:484)
              linked exception is:
              java.net.SocketException: Connection reset by peer: socket write error
              at java.net.SocketOutputStream.socketWrite(Native Method)
              at java.net.SocketOutputStream.write(SocketOutputStream.java:62)
              at java.io.DataOutputStream.writeShort(DataOutputStream.java:150)
              at org.jboss.mq.il.uil.multiplexor.StreamMux.closeStream(StreamMux.java:123)
              at org.jboss.mq.il.uil.multiplexor.MuxOutputStream.close(MuxOutputStream.java:43)
              at java.io.FilterOutputStream.close(FilterOutputStream.java:146)
              at java.io.ObjectOutputStream.close(ObjectOutputStream.java:1476)
              at org.jboss.mq.il.uil.UILClientILService.run(UILClientILService.java:180)
              at java.lang.Thread.run(Thread.java:484)
              [Connection] Disconnected from server
              [Default] org.jboss.mq.SpyJMSException: Error whle closing UILClientIL connection
              [Default] at org.jboss.mq.Connection.asynchFailure(Connection.java:350)
              [Default]
              [Default] at org.jboss.mq.il.uil.UILClientILService.run(UILClientILService.java:183)
              [Default]
              [Default] at java.lang.Thread.run(Thread.java:484)
              [Default]
              [Default] linked exception is:
              [Default] java.net.SocketException: Connection reset by peer: socket write error
              [Default] at java.net.SocketOutputStream.socketWrite(Native Method)
              [Default]
              [Default] at java.net.SocketOutputStream.write(SocketOutputStream.java:62)
              [Default]
              [Default] at java.io.DataOutputStream.writeShort(DataOutputStream.java:150)
              [Default]
              [Default] at org.jboss.mq.il.uil.multiplexor.StreamMux.closeStream(StreamMux.java:123)
              [Default]
              [Default] at org.jboss.mq.il.uil.multiplexor.MuxOutputStream.close(MuxOutputStream.java:43)
              [Default]
              [Default] at java.io.FilterOutputStream.close(FilterOutputStream.java:146)
              [Default]
              [Default] at java.io.ObjectOutputStream.close(ObjectOutputStream.java:1476)
              [Default]
              [Default] at org.jboss.mq.il.uil.UILClientILService.run(UILClientILService.java:180)
              [Default]
              [Default] at java.lang.Thread.run(Thread.java:484)
              [Default]

              Any idea what causes this exception and the poor performance?
              Thanks,
              Sebastian

              • 4. Re: Intermittent
                Hiram Chirino Expert

                > Thanks a lot - this seems to have solved the
                > unreliability problem. Unfortunately, however,
                > performance has suffered dramatically:
                >
                > With QueueConnectionFactory (uses OIL as far as
                > ar as I can see from the documentation):
                > 300 messages / second
                > With UILConnectionFactory:
                > 1 message per second (!)
                >

                It's been known that the UIL has worse peformance than the OIL, but I never knew it was THAT bad. It could be time for someone to bring out the profiler and figure out where slow down is happening at.

                > Is this the price to pay, or am I missing something?
                > All I have changed in the code is replacing
                >
                > Object tmp =
                > tmp = iniCtx.lookup("ConnectionFactory");
                > QueueConnectionFactory qcf =
                > qcf = (QueueConnectionFactory) tmp;
                > by
                > Object tmp =
                > tmp = iniCtx.lookup("UILConnectionFactory");
                > QueueConnectionFactory qcf =
                > qcf = (QueueConnectionFactory) tmp;
                >

                That is all you have to change.

                > Do I need to do anything else to switch from OIL to
                > UIL? Also, closing the connection now results in the
                > following error (following is snippet from
                > server.log):
                >
                > [Default] ### About to call conn.stop()
                > [Connection] Stoping connection, ClientID=ID3
                > [ClientConsumer:ID3]
                > ClientConsumer:ID3->setEnabled(enabled=false)
                > [Default] ### About to call session.close()
                > [Connection] Connection:
                > removeSession(dest=QUEUE.testQueue)
                > [JMSServer] Server: unsubscribe(idConnection=ID3)
                > [ClientConsumer:ID3]
                > ClientConsumer:ID3->removeSubscription(subscriberId=-2
                > 47483648)
                > [Default] ### About to call conn.close()
                > [Connection] Closing sessions, ClientID=ID3
                > [Connection] Closed sessions
                > [Connection] Disconnecting from server
                > [JMSServer]
                > JMSServer->connectionClosing(dc=SpyDistributedConnecti
                > n:ID3)
                > [ClientConsumer:ID3] ClientConsumer:ID3->close()
                > [Connection] java.net.SocketException: Connection
                > reset by peer: socket write error
                > [Connection] JBossMQ Connection failure:
                > org.jboss.mq.SpyJMSException: Error whle closing
                > UILClientIL connection
                > at
                > org.jboss.mq.Connection.asynchFailure(Connection.java
                > 350)
                > at
                > org.jboss.mq.il.uil.UILClientILService.run(UILClientI
                > Service.java:183)
                > at java.lang.Thread.run(Thread.java:484)
                > linked exception is:
                > java.net.SocketException: Connection reset by peer:
                > socket write error
                > at java.net.SocketOutputStream.socketWrite(Native
                > Method)
                > at
                > java.net.SocketOutputStream.write(SocketOutputStream.
                > ava:62)
                > at
                > java.io.DataOutputStream.writeShort(DataOutputStream.
                > ava:150)
                > at
                > org.jboss.mq.il.uil.multiplexor.StreamMux.closeStream
                > StreamMux.java:123)
                > at
                > org.jboss.mq.il.uil.multiplexor.MuxOutputStream.close
                > MuxOutputStream.java:43)
                > at
                > java.io.FilterOutputStream.close(FilterOutputStream.j
                > va:146)
                > at
                > java.io.ObjectOutputStream.close(ObjectOutputStream.j
                > va:1476)
                > at
                > org.jboss.mq.il.uil.UILClientILService.run(UILClientI
                > Service.java:180)
                > at java.lang.Thread.run(Thread.java:484)
                > [Connection] Disconnected from server
                > [Default] org.jboss.mq.SpyJMSException: Error whle
                > closing UILClientIL connection
                > [Default] at
                > org.jboss.mq.Connection.asynchFailure(Connection.java:
                > 50)
                > [Default]
                > [Default] at
                > org.jboss.mq.il.uil.UILClientILService.run(UILClientIL
                > ervice.java:183)
                > [Default]
                > [Default] at java.lang.Thread.run(Thread.java:484)
                > [Default]
                > [Default] linked exception is:
                > [Default] java.net.SocketException: Connection reset
                > by peer: socket write error
                > [Default] at
                > java.net.SocketOutputStream.socketWrite(Native
                > Method)
                > [Default]
                > [Default] at
                > java.net.SocketOutputStream.write(SocketOutputStream.j
                > va:62)
                > [Default]
                > [Default] at
                > java.io.DataOutputStream.writeShort(DataOutputStream.j
                > va:150)
                > [Default]
                > [Default] at
                > org.jboss.mq.il.uil.multiplexor.StreamMux.closeStream(
                > treamMux.java:123)
                > [Default]
                > [Default] at
                > org.jboss.mq.il.uil.multiplexor.MuxOutputStream.close(
                > uxOutputStream.java:43)
                > [Default]
                > [Default] at
                > java.io.FilterOutputStream.close(FilterOutputStream.ja
                > a:146)
                > [Default]
                > [Default] at
                > java.io.ObjectOutputStream.close(ObjectOutputStream.ja
                > a:1476)
                > [Default]
                > [Default] at
                > org.jboss.mq.il.uil.UILClientILService.run(UILClientIL
                > ervice.java:180)
                > [Default]
                > [Default] at java.lang.Thread.run(Thread.java:484)
                > [Default]

                I have seen this before, I think it has been fixed. Are you running of the CVS version or an older version?

                Regards,
                Hiram

                • 5. Re: Intermittent
                  Sebastian Hallensleben Newbie

                  I am using JBoss 2.4.3 - unfortunately I probably have to stick to the latest officially stable release (JBoss will support production environment).

                  UIL performance is definitely too slow, so I have gone back to debugging OIL. I have now managed to put together a piece of code that *reproducibly* causes the original problem.
                  The code simply tries to call createQueueConnection() several times. On the fourth attempt, I always get a java.net.SocketException.

                  This makes me wonder whether maybe the JMS Server runs out of available sockets? (Hiram, this confirms your earlier suspicion that server sockets are to blame). Has anyone seen this problem before, or has an idea how to solve it? Is there a setting somewhere that I can increase?

                  Here is the code (invoked from the init() method of a HttpServlet):

                  System.getProperties().setProperty("java.naming.provider.url","localhost:1099");
                  //get JNDI context and connection factory
                  jndiContext = new InitialContext();
                  Object tmp=jndiContext.lookup("QueueConnectionFactory");
                  queueConnectionFactory = (QueueConnectionFactory) tmp;

                  //get queue and queue connection
                  qWFD = (Queue) jndiContext.lookup(qWFDName);
                  System.out.println("++++++++ MessageSender: createQueueConnection");
                  queueConnection=queueConnectionFactory.createQueueConnection();

                  // following lines for bughunting only
                  System.out.println("******** MessageSender: createQueueConnection 2");
                  QueueConnection x=queueConnectionFactory.createQueueConnection();
                  System.out.println("******** MessageSender: createQueueConnection 3");
                  QueueConnection y=queueConnectionFactory.createQueueConnection();
                  System.out.println("******** MessageSender: createQueueConnection 4"); //EXCEPTION THROWN HERE
                  QueueConnection z=queueConnectionFactory.createQueueConnection();
                  System.out.println("******** MessageSender: createQueueConnection 5");
                  QueueConnection zz=queueConnectionFactory.createQueueConnection();


                  And here is the corresponding console output:

                  [SpyConnectionFactoryObjectFactory] SpyConnectionFactoryObjectFactory->getObjectInstance()
                  [SpyDestinationObjectFactory] SpyDestinationObjectFactory->getObjectInstance()
                  [Default] ++++++++ MessageSender: createQueueConnection
                  [Connection] Connection Initializing
                  [Connection] Getting the serverIL
                  [Connection] Authenticating
                  [Connection] Starting the clientIL service
                  [OILClientILService] Waiting for the server to connect to me
                  [OILServerILService] The OILClientIL Connection is set up
                  [Connection] Connection establishment successful
                  [Default] ******** MessageSender: createQueueConnection 2
                  [Connection] Connection Initializing
                  [Connection] Getting the serverIL
                  [Connection] Authenticating
                  [Connection] Starting the clientIL service
                  [OILServerILService] The OILClientIL Connection is set up
                  [Connection] Connection establishment successful
                  [Default] ******** MessageSender: createQueueConnection 3
                  [Connection] Connection Initializing
                  [Connection] Getting the serverIL
                  [Connection] Authenticating
                  [OILClientILService] Waiting for the server to connect to me
                  [Connection] Starting the clientIL service
                  [OILServerILService] The OILClientIL Connection is set up
                  [Connection] Connection establishment successful
                  [Default] ******** MessageSender: createQueueConnection 4
                  [Connection] Connection Initializing
                  [Connection] Getting the serverIL
                  [Connection] Authenticating
                  [OILClientILService] Waiting for the server to connect to me
                  [Connection] Starting the clientIL service
                  [Connection] java.net.SocketException: listen failed (code=10055)
                  [Default] org.jboss.mq.SpyJMSException: Cannot start a the client IL service
                  [Default] at org.jboss.mq.Connection.startILService(Connection.java:428)
                  [Default]
                  [Default] at org.jboss.mq.Connection.(Connection.java:119)
                  [Default]
                  [Default] at org.jboss.mq.Connection.(Connection.java:135)
                  [Default]
                  [Default] at org.jboss.mq.SpyConnection.(SpyConnection.java:58)
                  [Default]
                  [Default] at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:91)
                  [Default]
                  [Default] at dmsystem.testjms.MessageSender.(MessageSender.java:42)
                  [Default]
                  [Default] at dmsystem.testjms.SendRecvClient.init(SendRecvClient.java:77)
                  [Default]
                  [Default] at javax.servlet.GenericServlet.init(GenericServlet.java:258)
                  [Default]
                  [Default] at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
                  [Default]
                  [Default] at org.apache.tomcat.core.Handler.init(Handler.java:215)
                  [Default]
                  [Default] at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
                  [Default]
                  [Default] at org.apache.tomcat.core.Handler.service(Handler.java:254)
                  [Default]
                  [Default] at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
                  [Default]
                  [Default] at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
                  [Default]
                  [Default] at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
                  [Default]
                  [Default] at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
                  [Default]
                  [Default] at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
                  [Default]
                  [Default] at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
                  [Default]
                  [Default] at java.lang.Thread.run(Thread.java:484)
                  [Default]
                  [Default] linked exception is:
                  [Default] java.net.SocketException: listen failed (code=10055)
                  [Default] at java.net.PlainSocketImpl.socketListen(Native Method)
                  [Default]
                  [Default] at java.net.PlainSocketImpl.listen(PlainSocketImpl.java:413)
                  [Default]
                  [Default] at java.net.ServerSocket.(ServerSocket.java:171)
                  [Default]
                  [Default] at java.net.ServerSocket.(ServerSocket.java:82)
                  [Default]
                  [Default] at org.jboss.mq.il.oil.OILClientILService.init(OILClientILService.java:225)
                  [Default]
                  [Default] at org.jboss.mq.GenericConnectionFactory.createClientILService(GenericConnectionFactory.java:69)
                  [Default]
                  [Default] at org.jboss.mq.Connection.startILService(Connection.java:421)
                  [Default]
                  [Default] at org.jboss.mq.Connection.(Connection.java:119)
                  [Default]
                  [Default] at org.jboss.mq.Connection.(Connection.java:135)
                  [Default]
                  [Default] at org.jboss.mq.SpyConnection.(SpyConnection.java:58)
                  [Default]
                  [Default] at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:91)
                  [Default]
                  [Default] at dmsystem.testjms.MessageSender.(MessageSender.java:42)
                  [Default]
                  [Default] at dmsystem.testjms.SendRecvClient.init(SendRecvClient.java:77)
                  [Default]
                  [Default] at javax.servlet.GenericServlet.init(GenericServlet.java:258)
                  [Default]
                  [Default] at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
                  [Default]
                  [Default] at org.apache.tomcat.core.Handler.init(Handler.java:215)
                  [Default]
                  [Default] at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
                  [Default]
                  [Default] at org.apache.tomcat.core.Handler.service(Handler.java:254)
                  [Default]
                  [Default] at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
                  [Default]
                  [Default] at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
                  [Default]
                  [Default] at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
                  [Default]
                  [Default] at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
                  [Default]
                  [Default] at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
                  [Default]
                  [Default] at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
                  [Default]
                  [Default] at java.lang.Thread.run(Thread.java:484)
                  [Default]
                  [JMSServer] JMSServer->connectionClosing(dc=null)


                  Thanks,
                  Sebastian

                  • 6. Re: Intermittent
                    Hiram Chirino Expert

                    I'll see if I can add a test case to the testsuite that does the logic you just posted. In the mean time, you might want to also try out the RMI IL... It might have better performance than the UIL.

                    • 7. Re: Intermittent
                      Sebastian Hallensleben Newbie

                      Would make me sleep better if I am not the only one seeing this problem :-)

                      RMI connection factory works OK. Here are some timings taken under the same conditions:

                      OIL: 600 messages/second (when it works)
                      RMI: 35 messages/second
                      UIL: ~1 message/second

                      Hence I am still hoping that OIL is going to work one day :-)

                      Just to add to my previous post with the code sample: Sometimes the exception is already thrown on the 2nd or 3rd call to createQueueConnection(), i.e. it is not always exactly the 4th call that causes the trouble.

                      Thanks,
                      Sebastian

                      • 8. Re: Intermittent
                        Arjav Parikh Newbie

                        I am in the same boat. I changed my ConnectionFactory to UILConnectionFactory and it seemed to work without throwing exceptions, but it is slow. Contrarary to your observation, I found RMI the slowest(aka OIL->UIL->RMI from faster to slower).

                        For the test purpose, I am running JBossMQ on Windows XP box and sender is sending messages from Linux box.

                        I would appreciate any solution to make ConnectionFactory work in my scenario.

                        Thanks a bunch for help.

                        Best Regards,
                        arjav

                        • 9. Re: Intermittent
                          Hiram Chirino Expert

                          Hi guys, I just added the test case posted previously to the the JBoss test suite. It loops as fast as it can to create 10 OIL connections and then closes then. It has not caused any errors on my system (Win2k, 1000mgz, jdk1.4)

                          Regards,
                          Hiram

                          • 10. Re: Intermittent "Cannot connect to the ConnectionReceiver/S
                            Sebastian Hallensleben Newbie

                            Hi,

                            Finally found a solution!!! (I am a happy man today :-) )

                            The root problem - as Hiram already suspected - is that Windows 98 does not provide enough concurrent sockets. The following registry change suggested by vincent_@mwebl.co.za fixed the problem for me:


                            Edit the registry :
                            HKEY_LOCAL_MACHINES\System\CurrentControlSet\Sevices\VxD\MSTCP

                            1. Right click, select New, String with name "MaxConnections"
                            2. Right click to modify to a value of 500 (300 for Win 98SE)
                            3. Repeat 1 & 2 for a name "Size/Small/Medium/Large" and value 3

                            Try 1000 and 2 if above was not sucessful


                            I also found some background info on those registry settings in Microsoft Knowledge base article Q158474.

                            Hope this helps a few other people as well.
                            Sebastian

                            • 11. Re: Intermittent "Cannot connect to the ConnectionReceiver/S
                              Kapil bansal Newbie

                              Yes, I have also faced the same problem. If you install jre1.4 on both client and server. Then it will work. If there is any query then please let me know..
                              Regards,
                              kapil bansal

                              • 12. Re: Intermittent "Cannot connect to the ConnectionReceiver/S
                                Alwyn Schoeman Newbie

                                Hi,

                                I am getting this problem again in version 3.0.3RC1. Both machines are running on linux and using j2sdk 1.4.0_01.

                                When I use OIL from a client on the same machine as the jboss server, then none of these errors occur.

                                If I use OIL from a client on another machine than the server then I get these errors:

                                ERROR [OILClientIL] Cannot connect to the ConnectionReceiver/Server
                                java.net.ConnectException: Connection refused

                                I can solve this by using IIOP in jms.properties, but I
                                would prefer using OIL.

                                I must add that I was not specifying -Djms.properties=jms_client.properties when I was getting the errors, as soon as I did it went away. Can not specifying a jms.properties file be the cause? Strang...