[jboss-jira] [JBoss JIRA] (WFLY-4347) NullPointerException in WebServerService.getListenerMap

Mayank Mittal (JIRA) issues at jboss.org
Fri Feb 13 22:37:49 EST 2015


    [ https://issues.jboss.org/browse/WFLY-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040309#comment-13040309 ] 

Mayank Mittal edited comment on WFLY-4347 at 2/13/15 10:37 PM:
---------------------------------------------------------------

We faced this issue wile migrating our product from Jboss 4.2.3 to WildFly 8.1.
Most important thing to note is that this exception is not thrown every time we start the WildFly server. 
Will try to provide a simple sample that can produce the same outcome.




was (Author: mayankmit2002):
We faced this issue wile migrating our product from Jboss 4.2.3 to WildFly 8.1.
Will try to provide a simple sample that can produce the same outcome.



> NullPointerException in WebServerService.getListenerMap
> -------------------------------------------------------
>
>                 Key: WFLY-4347
>                 URL: https://issues.jboss.org/browse/WFLY-4347
>             Project: WildFly
>          Issue Type: Bug
>          Components: Web Services
>    Affects Versions: 8.1.0.Final
>         Environment: Windows, Linux 
> Java 8
>            Reporter: Mayank Mittal
>            Assignee: Tomaz Cerar
>
> While deploying a SLSB annotated with WebService causes NullPointerException in WebServerService.getListenerMap
> {noformat}
> 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)
> {noformat}
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list