This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Exception while adding folder to JBOSS_CLASSPATH Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Exception while adding folder to JBOSS_CLASSPATH" Watch "Exception while adding folder to JBOSS_CLASSPATH" New topic
Author

Exception while adding folder to JBOSS_CLASSPATH

sowjan kumar
Greenhorn

Joined: Oct 09, 2004
Posts: 23
I have java class files stored in classes folder which is not in the classpath and i added the classpath in a seperate batch file as folows

JBOSS_CLASSPATH=%C:/CLASSES%

And I ran in to the following

Failed to boot JBoss:
java.lang.RuntimeException: Cannot create MBeanServer
at org.jboss.mx.server.MBeanServerImpl.<init>(MBeanServerImpl.java:224)
at org.jboss.mx.server.MBeanServerBuilderImpl.newMBeanServer(MBeanServerBuilderImpl.java:56)
at javax.management.MBeanServerFactory.createMBeanServerImpl(MBeanServerFactory.java:207)
at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:44)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:369)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)
at org.jboss.Main.boot(Main.java:195)
at org.jboss.Main$1.run(Main.java:463)
at java.lang.Thread.run(Thread.java:534)
Caused by: javax.management.NotCompliantMBeanException: Cannot register MBean: JMImplementation:type=MBeanServerDelegate
at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:300)
at org.jboss.mx.server.MBeanServerImpl.<init>(MBeanServerImpl.java:200)
... 8 more
Caused by: java.lang.NullPointerException
at org.jboss.mx.modelmbean.ModelMBeanInvoker.setModelMBeanInfo(ModelMBeanInvoker.java:170)
at org.jboss.mx.modelmbean.XMBean.<init>(XMBean.java:241)
at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:180)
... 9 more
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

Maybe setting that removes the regular JBoss class path. It looks like the MBean Server is not starting which is really the main part of JBoss, so nothing after that can even work.

It is like it no longer has the jars that are in the Where_You_Installed_JBoss\lib are in the classpath.

%JBOSS_INSTALL_DIRECTORY% is just a place holder I made up, there is no such var.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
sowjan kumar
Greenhorn

Joined: Oct 09, 2004
Posts: 23
Iam having my own batch file and the contents are as follows

set JB_CLASS=C:\myproject\jboss\classes //this contains all the java classes
set JBOSS_CLASSPATH=%JB_CLASS%

.\run.bat


In run.bat i see the following

echo %JBOSS_CLASSPATH%
if "%JBOSS_CLASSPATH%" == "" (
set JBOSS_CLASSPATH=%JAVAC_JAR%;%RUNJAR%
) ELSE (
set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%JAVAC_JAR%;%RUNJAR%
)
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

And you effectively overwrite that variable in your batch file when you put

set JBOSS_CLASSPATH=%JB_CLASS%

Try this instead


set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%JB_CLASS%

Mark
sowjan kumar
Greenhorn

Joined: Oct 09, 2004
Posts: 23
Thanks Mark..But still the same issue. The exception as follows

Failed to boot JBoss:
java.lang.RuntimeException: Cannot create MBeanServer
at org.jboss.mx.server.MBeanServerImpl.<init>(MBeanServerImpl.java:224)
at org.jboss.mx.server.MBeanServerBuilderImpl.newMBeanServer(MBeanServerBuilderImpl.java:56)
at javax.management.MBeanServerFactory.createMBeanServerImpl(MBeanServerFactory.java:207)
at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:44)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:369)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)
at org.jboss.Main.boot(Main.java:195)
at org.jboss.Main$1.run(Main.java:463)
at java.lang.Thread.run(Thread.java:534)
Caused by: javax.management.NotCompliantMBeanException: Cannot register MBean: JMImplementation:type=MBeanServerDelegate
at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:300)
at org.jboss.mx.server.MBeanServerImpl.<init>(MBeanServerImpl.java:200)
... 8 more
Caused by: java.lang.NullPointerException
at org.jboss.mx.modelmbean.ModelMBeanInvoker.setModelMBeanInfo(ModelMBeanInvoker.java:170)
at org.jboss.mx.modelmbean.XMBean.<init>(XMBean.java:241)
at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:180)
... 9 more
Press any key to continue . . .
sowjan kumar
Greenhorn

Joined: Oct 09, 2004
Posts: 23
Thanks a lot Mark. Solved this issue by cleaning the classes inside JB_CLASS folder. I had some .xml and .properties file inside that and after removign that it worked fine.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Exception while adding folder to JBOSS_CLASSPATH