ICEfaces
  1. ICEfaces
  2. ICE-2965

ICEfaces AHS: shutting down GlassFish causes javax.jms.JMSException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7RC1
    • Fix Version/s: 1.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      GlassFish V2.UR1, ICEfaces AHS

      Description

      When shutting down GlassFish (having AHS deployed to it) the following exception is thrown:

      [#|2008-04-08T16:31:29.450-0600|SEVERE|sun-appserver9.1|com.icesoft.faces.util.event.servlet.MessagingContextEventPublisher|_ThreadID=45;_ThreadName=RMI TCP Connection(17)-127.0.0.1;_RequestID=1ba934fd-aef1-409a-bf0a-36e20fc04fba;|Failed to stop message delivery!
      com.icesoft.net.messaging.MessageServiceException: javax.jms.JMSException: MQJMSRA_DC2001: Unsupported:stop():inACC=false:connectionId=2328107226950913280
              at com.icesoft.net.messaging.jms.JMSAdapter.stop(JMSAdapter.java:274)
              at com.icesoft.net.messaging.MessageServiceClient.stop(MessageServiceClient.java:680)
              at com.icesoft.faces.util.event.servlet.MessagingContextEventPublisher.tearDownMessageServiceClient(MessagingContextEventPublisher.java:189)
              at com.icesoft.faces.util.event.servlet.MessagingContextEventPublisher.publish(MessagingContextEventPublisher.java:91)
              at com.icesoft.faces.util.event.servlet.ContextEventRepeater.contextDestroyed(ContextEventRepeater.java:152)
              at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4567)
              at org.apache.catalina.core.StandardContext.stop(StandardContext.java:5355)
              at com.sun.enterprise.web.WebModule.stop(WebModule.java:357)
              at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1286)
              at com.sun.enterprise.web.VirtualServer.stop(VirtualServer.java:424)
              at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1286)
              at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:538)
              at org.apache.catalina.startup.Embedded.stop(Embedded.java:970)
              at com.sun.enterprise.web.WebContainer.stop(WebContainer.java:931)
              at com.sun.enterprise.web.PEWebContainer.stopInstance(PEWebContainer.java:814)
              at com.sun.enterprise.web.PEWebContainerLifecycle.onShutdown(PEWebContainerLifecycle.java:95)
              at com.sun.enterprise.server.ApplicationServer.onShutdown(ApplicationServer.java:549)
              at com.sun.enterprise.server.ondemand.OnDemandServer.onShutdown(OnDemandServer.java:131)
              at com.sun.enterprise.server.Shutdown.startShutdown(Shutdown.java:75)
              at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeShutdownEventListener(AdminEventMulticaster.java:1501)
              at com.sun.enterprise.admin.event.AdminEventMulticaster.handleShutdownEvent(AdminEventMulticaster.java:1490)
              at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:480)
              at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
              at com.sun.enterprise.admin.server.core.channel.AdminChannelServer.sendNotification(AdminChannelServer.java:121)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
              at sun.rmi.transport.Transport$1.run(Transport.java:153)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
              at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
              at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.jms.JMSException: MQJMSRA_DC2001: Unsupported:stop():inACC=false:connectionId=2328107226950913280
              at com.sun.messaging.jms.ra.DirectConnection._unsupported(DirectConnection.java:864)
              at com.sun.messaging.jms.ra.DirectConnection.stop(DirectConnection.java:441)
              at com.icesoft.net.messaging.jms.JMSSubscriberConnection.stop(JMSSubscriberConnection.java:179)
              at com.icesoft.net.messaging.jms.JMSAdapter.stop(JMSAdapter.java:270)
              ... 34 more

      This prevents GlassFish to shutdown completely.

        Activity

        Hide
        Jack Van Ooststroom added a comment -

        Changed Fix Version(s) to 1.7

        Show
        Jack Van Ooststroom added a comment - Changed Fix Version(s) to 1.7
        Hide
        Jack Van Ooststroom added a comment -

        There seemed to be 2 issues with this.

        1. The first issue is related to the mentioned exception:

        According to the J2EE 1.3 Specification:

        In addition, use of the following methods onjavax.jms.Connection objects
        by applications in web and EJB containers may interfere with the connection
        management functions of the container and must not be used:

        • setExceptionListener
        • stop
        • setClientID

        According to the J2EE 1.4 Specification:

        The following methods may only be used by application components
        executing in the application client container:

        • javax.jms.Session method setMessageListener
        • javax.jms.Session method getMessageListener
        • javax.jms.Session method run
        • javax.jms.QueueConnection method createConnectionConsumer
        • javax.jms.TopicConnection method createConnectionConsumer
        • javax.jms.TopicConnection method createDurableConnectionConsumer
        • javax.jms.MessageConsumer method getMessageListener
        • javax.jms.MessageConsumer method setMessageListener
        • javax.jms.Connection method setExceptionListener
        • javax.jms.Connection method stop
        • javax.jms.Connection method setClientID

        As ICEfaces operates in the Web Container we should not be invoking the stop() method on the javax.jms.Connection.

        I removed the stop() invocation which seems to get rid off the exception.

        2. The second issue is related to the stall:

        A thread dump showed that there were two threads in waiting state that were of interest. One thread was stuck in the javax.jms.Session.close() method and the other thread was stuck in the javax.jms.TopicSubscriber.receive() method. I changed the latter invocation to javax.jms.TopicSubscriber.receive(1000). Now at least every second the MessageReceiver will come out of this invocation to have a chance to notice any stop requests. This seems to resolve the stall.

        Marking this one as FIXED.

        Show
        Jack Van Ooststroom added a comment - There seemed to be 2 issues with this. 1. The first issue is related to the mentioned exception: According to the J2EE 1.3 Specification: In addition, use of the following methods onjavax.jms.Connection objects by applications in web and EJB containers may interfere with the connection management functions of the container and must not be used: setExceptionListener stop setClientID According to the J2EE 1.4 Specification: The following methods may only be used by application components executing in the application client container: javax.jms.Session method setMessageListener javax.jms.Session method getMessageListener javax.jms.Session method run javax.jms.QueueConnection method createConnectionConsumer javax.jms.TopicConnection method createConnectionConsumer javax.jms.TopicConnection method createDurableConnectionConsumer javax.jms.MessageConsumer method getMessageListener javax.jms.MessageConsumer method setMessageListener javax.jms.Connection method setExceptionListener javax.jms.Connection method stop javax.jms.Connection method setClientID As ICEfaces operates in the Web Container we should not be invoking the stop() method on the javax.jms.Connection. I removed the stop() invocation which seems to get rid off the exception. 2. The second issue is related to the stall: A thread dump showed that there were two threads in waiting state that were of interest. One thread was stuck in the javax.jms.Session.close() method and the other thread was stuck in the javax.jms.TopicSubscriber.receive() method. I changed the latter invocation to javax.jms.TopicSubscriber.receive(1000). Now at least every second the MessageReceiver will come out of this invocation to have a chance to notice any stop requests. This seems to resolve the stall. Marking this one as FIXED.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jack Van Ooststroom
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: