2 Replies Latest reply on Jun 11, 2009 4:02 AM by 805011

    Problem with tomcat shutting down when using Sun message queue

    807581
      I currently have a web application that creates standard producers and consumers and communicates with our back office via sun message queue broker. Everything works find until you try to stop tomcat (currently running 6.0.18). We are using imq-4.3. I have double check to ensure we are calling close on the session and connection. After issuing a stop command on tomcat, we finally see this spit out...

      Exception in thread "imqConnectionFlowControl-0" java.lang.NullPointerException
           at com.sun.messaging.jmq.net.IPAddress.clear(IPAddress.java:128)
           at com.sun.messaging.jmq.net.IPAddress.<init>(IPAddress.java:121)
           at com.sun.messaging.jmq.io.SysMessageID.<init>(SysMessageID.java:80)
           at com.sun.messaging.jmq.io.ReadOnlyPacket.<init>(ReadOnlyPacket.java:100)
           at com.sun.messaging.jmq.io.ReadWritePacket.<init>(ReadWritePacket.java:67)
           at com.sun.messaging.jmq.jmsclient.ProtocolHandler.ping(ProtocolHandler.java:4039)
           at com.sun.messaging.jmq.jmsclient.FlowControl.pingBroker(FlowControl.java:379)
           at com.sun.messaging.jmq.jmsclient.FlowControl.run(FlowControl.java:310)
           at java.lang.Thread.run(Thread.java:637)
      Exception in thread "imqConnectionFlowControl-0" java.lang.NullPointerException
           at com.sun.messaging.jmq.net.IPAddress.clear(IPAddress.java:128)
           at com.sun.messaging.jmq.net.IPAddress.<init>(IPAddress.java:121)
           at com.sun.messaging.jmq.io.SysMessageID.<init>(SysMessageID.java:80)
           at com.sun.messaging.jmq.io.ReadOnlyPacket.<init>(ReadOnlyPacket.java:100)
           at com.sun.messaging.jmq.io.ReadWritePacket.<init>(ReadWritePacket.java:67)
           at com.sun.messaging.jmq.jmsclient.ProtocolHandler.ping(ProtocolHandler.java:4039)
           at com.sun.messaging.jmq.jmsclient.FlowControl.pingBroker(FlowControl.java:379)
           at com.sun.messaging.jmq.jmsclient.FlowControl.run(FlowControl.java:310)
           at java.lang.Thread.run(Thread.java:637)

      Has anyone else encountered this problem? Any tips on how I can resolve this, so I don't have to issue kill -9 everytime I want to stop tomcat?
        • 1. Re: Problem with tomcat shutting down when using Sun message queue
          807581
          I tried a simple servlet that creates JMS connection/session/producer and sends a message to broker, then close or not close the JMS connection, then shutdown tomcat using its shutdown.sh, and didn't see any problem. I used apache-tomcat-6.0.20.
          • 2. Re: Problem with tomcat shutting down when using Sun message queue
            805011
            The code is being generated from the ping handler, you can turn that by changing the imqPingInterval connection factory property. I don't see an obvious way to turn the behavior complete off - but you can set it to a really really really large time (its in seconds) so that it doesn't happen anytime soon.

            I'm not sure, however, that making that change will fix your problem.

            The error you are seeing doesn't make a lot of sense (unless this is some sort of JDK or class loading issue)

            From looking @ the code, the exception is being thrown at this line:

                 System.arraycopy(nullAddr, 0, ip, 0, nullAddr.length);

            this means that nullAddr must be null. However, since that is a private static byte array that is never modified or changes while the system is running ... it doesn't make a lot of sense unless something strange is happening outside of MQ

            // A null IPv6 address
            static private byte[] nullAddr =
                 { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
                 (byte)0xFF, (byte)0xFF,
            0x0, 0x0, 0x0, 0x0 };

            aka it can't happen, but it is and I don't have a good reason you are getting that exception ...

            Have you tried changing JDKs , or ???