Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-4347

NullPointerException in WebServerService.getListenerMap

XMLWordPrintable

      While deploying a SLSB annotated with WebService causes NullPointerException in WebServerService.getListenerMap

      org.jboss.msc.service.StartException in service jboss.deployment.subunit."myTest.ear"."myTest.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "myTest.jar" of deployment "myTest.ear"
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NullPointerException
      at java.util.LinkedList$ListItr.next(Unknown Source)
      at org.wildfly.extension.undertow.WebServerService.getListenerMap(WebServerService.java:73)
      at org.wildfly.extension.undertow.WebServerService.getPort(WebServerService.java:49)
      at org.jboss.as.webservices.config.WebServerInfoImpl.getPort(WebServerInfoImpl.java:36)
      at org.jboss.ws.common.management.AbstractServerConfig.getConnectorPort(AbstractServerConfig.java:207)
      at org.jboss.ws.common.management.AbstractServerConfig.getWebServicePort(AbstractServerConfig.java:170)
      at org.jboss.ws.common.deployment.EndpointAddressDeploymentAspect$PortValue.getPortValue(EndpointAddressDeploymentAspect.java:198)
      at org.jboss.ws.common.deployment.EndpointAddressDeploymentAspect$PortValue.getValue(EndpointAddressDeploymentAspect.java:191)
      at org.jboss.ws.common.deployment.EndpointAddressDeploymentAspect.start(EndpointAddressDeploymentAspect.java:77)
      at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:75)
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159)
      

      Upon looking into the source code, I found that the the collection used to hold registered listeners in org.wildfly.extension.undertow.Server class is LinkedList.
      What I understand from the code is that this list is getting accessed by two threads at some moment of time and causes the NullPointerException
      plz. refer http://stackoverflow.com/questions/18055024/nullpointer-exception-in-linkedlist-while-using-for-each-loop.
      I think one should use ConcurrentHashSet to avoid such situations.

        1. server.log
          66 kB
          Mayank Mittal

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              mayankmit2002 Mayank Mittal (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: