Uploaded image for project: 'JBoss WFK 2'
  1. JBoss WFK 2
  2. WFK2-646

Sporadic NPE in Seam Remoting SubscriptionRequest

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.6.0.ER1
    • Fix Version/s: 2.7.0.GA
    • Component/s: Seam 2
    • Labels:
      None
    • Target Release:
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      A workaround is to force the topicConnection to be created during app startup, so there would be no risk of having this race during concurrent requests. e.g.:

      import org.jboss.seam.annotations.*; 
      import org.jboss.seam.ScopeType; 
      import javax.jms.TopicConnection; 
      
      @Name("topicConnectionStartup") 
      @Startup 
      @Scope(ScopeType.APPLICATION)
      public class TopicConnectionStartup { 
          @In(value="org.jboss.seam.jms.topicConnection", create=true) 
          private TopicConnection topicConnection; 
      
          @Create 
          public void init() { 
              topicConnection.toString(); // arbitrary call to invoke injection of topicConnection 
          }
      }
      
      Show
      A workaround is to force the topicConnection to be created during app startup, so there would be no risk of having this race during concurrent requests. e.g.: import org.jboss.seam.annotations.*; import org.jboss.seam.ScopeType; import javax.jms.TopicConnection; @Name( "topicConnectionStartup" ) @Startup @Scope(ScopeType.APPLICATION) public class TopicConnectionStartup { @In(value= "org.jboss.seam.jms.topicConnection" , create= true ) private TopicConnection topicConnection; @Create public void init() { topicConnection.toString(); // arbitrary call to invoke injection of topicConnection } }
    • Affects:
      Release Notes
    • Release Notes Docs Status:
      Documented as Known Issue
    • Release Notes Text:
      Hide
      A NullPointerException from Seam's SubscriptionRequest component is intermittently triggered when a subscription request is issued by a client to a JMS topic shortly after initiating an endpoint connection. This is caused by non-thread-safe behaviour of a built-in Seam component resulting in race conditions arising. To work around this, eliminate the race condition by forcing the topicConnection component to be created during application startup. This is achieved by including the following component in the application:
      {code:java}
      import org.jboss.seam.annotations.*;
      import org.jboss.seam.ScopeType;
      import javax.jms.TopicConnection;

      @Name("topicConnectionStartup")
      @Startup
      @Scope(ScopeType.APPLICATION)
      public class TopicConnectionStartup {
          @In(value="org.jboss.seam.jms.topicConnection", create=true)
          private TopicConnection topicConnection;

          @Create
          public void init() {
              topicConnection.toString(); // arbitrary call to invoke injection of topicConnection
          }
      }
      {code}
      Show
      A NullPointerException from Seam's SubscriptionRequest component is intermittently triggered when a subscription request is issued by a client to a JMS topic shortly after initiating an endpoint connection. This is caused by non-thread-safe behaviour of a built-in Seam component resulting in race conditions arising. To work around this, eliminate the race condition by forcing the topicConnection component to be created during application startup. This is achieved by including the following component in the application: {code:java} import org.jboss.seam.annotations.*; import org.jboss.seam.ScopeType; import javax.jms.TopicConnection; @Name("topicConnectionStartup") @Startup @Scope(ScopeType.APPLICATION) public class TopicConnectionStartup {     @In(value="org.jboss.seam.jms.topicConnection", create=true)     private TopicConnection topicConnection;     @Create     public void init() {         topicConnection.toString(); // arbitrary call to invoke injection of topicConnection     } } {code}

      Description

      The following NPE appeared in ChatroomFunctionalTest,
      in org.jboss.seam.remoting.messaging.SubscriptionRequest:31:

      10:02:53,444 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "seam-chatroom.ear" (runtime-name : "seam-chatroom.ear")
      10:03:06,199 ERROR [org.jboss.seam.remoting.messaging.SubscriptionRegistry] (http-localhost/127.0.0.1:8080-6) java.lang.NullPointerException
      10:03:06,200 ERROR [org.jboss.seam.remoting.Remoting] (http-localhost/127.0.0.1:8080-6) Error: java.lang.NullPointerException
      	at org.jboss.seam.remoting.messaging.SubscriptionRequest.marshal(SubscriptionRequest.java:31) [jboss-seam-remoting-2.3.4.Final-redhat-1.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.remoting.SubscriptionHandler.marshalResponse(SubscriptionHandler.java:108) [jboss-seam-remoting-2.3.4.Final-redhat-1.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.remoting.SubscriptionHandler.handle(SubscriptionHandler.java:97) [jboss-seam-remoting-2.3.4.Final-redhat-1.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.remoting.Remoting.getResource(Remoting.java:111) [jboss-seam-remoting-2.3.4.Final-redhat-1.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) [jboss-seam.jar:2.3.4.Final-redhat-1]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.4.0.Final-redhat-12.jar:7.4.0.Final-redhat-12]
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
      	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0]
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  manaRH Marek Novotny
                  Reporter:
                  rsmeral Ron Šmeral
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: