NPE in JBossWS on JBoss 4.2.2 with jmxremote enabled

By : Jeremy

I am trying to set up JBoss 4.2.2 and JConsole for remote monitoring. As per many of the how-to's I have found on the web to do this you need to enable jmxremote by setting the following options in run.conf. (I realize the other two opts disable authentication)


Which results in the following exception:

13:06:56,418 INFO [TomcatDeployer] performDeployInternal :: deploy, ctxPath=/services, warUrl=.../tmp/deploy/tmp34585xxxxxxxxx.ear-contents/mDate-Services-exp.war/
13:06:57,706 WARN [AbstractServerConfig] getWebServicePort :: Unable to calculate 'WebServicePort', using default '8080'
13:06:57,711 WARN [AbstractServerConfig] getWebServicePort :: Unable to calculate 'WebServicePort', using default '8080'
13:06:58,070 WARN [AbstractServerConfig] getWebServicePort :: Unable to calculate 'WebServicePort', using default '8080'
13:06:58,071 WARN [AbstractServerConfig] getWebServicePort :: Unable to calculate 'WebServicePort', using default '8080'
13:06:58,138 ERROR [MainDeployer] start :: Could not start deployment: file:/opt/jboss-4.2.2.GA/server/default/tmp/deploy/tmp34585xxxxxxxxx.ear-contents/xxxxx-Services.war
at org.jboss.wsf.stack.jbws.WSDLFilePublisher.getPublishLocation(
at org.jboss.wsf.stack.jbws.WSDLFilePublisher.publishWsdlFiles(
at org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect.create(
at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(
at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy( 

My application uses JWS which according to this bug:

Suggests this workaround:

JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"


I've tried that however that then throws the following exception while trying to deploy a sar file in my ear which only contains on class which implements Schedulable for a couple of scheduled jobs my application requires:

Caused by: java.lang.NullPointerException
at EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.hash(
at EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.get(

Any suggestions on where to go from here?


I have also tried the following variation:

JAVA_OPTS="$JAVA_OPTS -DmbipropertyFile=../server/default/conf/  -DpropertyFile=../server/default/conf/ -Dwicket.configuration=DEVELOPMENT"
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"

I'm using JDK 1.6.0_01-b06

By : Jeremy


Had a similar issue, but with JBoss Seam: take a look at JBSEAM-4029. As one of the workarounds it suggests to override the class running into the NPE - in Seam's case the JBossClusterMonitor.

I bet the JWS code is running into exact same issue, i.e. ending up calling MBeanServerFactory.findMBeanServer(null) at some point in time. The stack trace should reveal which exact class does this.

By : anikitin

I don't know if this is related, but JBoss has a tendency to redirect to itself. If you connect to a host, say jboss.localdomain:3873, wanting to connect to a ejb, JBoss might lookup its own hostname and redirect to the address it gets from there. If you have a public hostname, it might find that instead (say, and tell the client to reconnect to Depending on your DNS, this might or might not be a reachable address from your client.

There are various varations of this problem, and as a bonus, sometimes the initial "connection check" works, so the client app deploys, but fails later on connect.

I'm not sure if there's a specific reason you're trying to use WS to access the mbean server, but with JConsole you can directly access a remote JVM. To do this use "service:jmx:rmi:///jndi/rmi://<remote-machine>:<port>/jmxrmi" (where <remote-machine> is whatever machine your trying to connect to and <port> is 11099) as the remote process.

I have used this to connect to any 1.6 JVM that exposes an mbean server (JBoss, ActiveMQ, etc).

By : mattkemp

This video can help you solving your question :)
By: admin