NPE in JBossWS on JBoss 4.2.2 with jmxremote enabled

11,722

I have honestly never tried this remoting approach. But, if both your client machine and the server happen to both be linux boxes or similar *nixes with SSH, then you can ssh -XCA to the server and start JConsole on the server and have the GUI display on your client machine with X port forwarding. A JConsole running locally to the server JVM you want to monitor should not have any trouble connecting.

I personally think that's a nifty trick but I realize that it dosn't really solve the problem of getting JConsole to connect remotely through JWS.

Share:
11,722
Jeremy
Author by

Jeremy

Updated on September 04, 2022

Comments

  • Jeremy
    Jeremy over 1 year

    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)

    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=11099"
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false" 
    

    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
    java.lang.NullPointerException
    at org.jboss.wsf.stack.jbws.WSDLFilePublisher.getPublishLocation(WSDLFilePublisher.java:303)
    at org.jboss.wsf.stack.jbws.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:103)
    at org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect.create(PublishContractDeploymentAspect.java:52)
    at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:115)
    at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:97) 
    ...
    

    My application uses JWS which according to this bug:

    https://jira.jboss.org/jira/browse/JBWS-1943

    Suggests this workaround:

    JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
    JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
    

    (https://developer.jboss.org/wiki/JBossWS-FAQ#jive_content_id_How_to_use_JDK_JMX_JConsole_with_JBossWS)

    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(ConcurrentReaderHashMap.java:298)
    at EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap.get(ConcurrentReaderHashMap.java:410)
    at org.jboss.mx.server.registry.BasicMBeanRegistry.getMBeanMap(BasicMBeanRegistry.java:959)
    at org.jboss.mx.server.registry.BasicMBeanRegistry.contains(BasicMBeanRegistry.java:577)
    

    Any suggestions on where to go from here?

    EDIT:

    I have also tried the following variation:

    JAVA_OPTS="$JAVA_OPTS -DmbipropertyFile=../server/default/conf/mbi.properties  -DpropertyFile=../server/default/conf/mdate.properties -Dwicket.configuration=DEVELOPMENT"
    JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
    JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
    

    I'm using JDK 1.6.0_01-b06

    • Jeremy
      Jeremy almost 15 years
      The problem was fixed in JBoss 4.2.3
  • Jeremy
    Jeremy over 15 years
    I've tried that and it works. However, JConsole is pretty resource intensive and it would have to be running for sometime to be useful. In addition X forwarding is so painfully slow with the graphs/updating that it's pretty much unusable anyway.
  • Jeremy
    Jeremy about 15 years
    You misread the question. I'm not using WS to access the mbean server. I'm using WS in the application.