VMware Cloud Community
omdahk1
Contributor
Contributor

Cannot autodiscover JBoss: Cannot instantiate class...NamingContextFactory

I have used an older version of Hyperic for about a year with success and am upgrading to 4.2. Servers/agents started successfully and several items have been discovered, but my instances of JBoss 3.2 are not being autodiscovered.

I receive the following error in the agent.log upon startup:
2010-01-07 14:15:34,594 ERROR [Thread-1] [RuntimeAutodiscoverer] Unexpected error running autodiscoverer for plugin: JBoss 3.2: Cannot instantiate class: org.jnp.interfaces.NamingContextFactoryorg.hyperic.hq.product.PluginException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory
at org.hyperic.hq.plugin.jboss.JBossDetector.discoverServiceTypes(JBossDetector.java:364)
at org.hyperic.hq.product.ServerDetector.discoverResources(ServerDetector.java:211)
at org.hyperic.hq.autoinventory.agent.server.RuntimeAutodiscoverer.doRuntimeScan_internal(RuntimeAutodi
scoverer.java:272)
at org.hyperic.hq.autoinventory.agent.server.RuntimeAutodiscoverer.doRuntimeScan(RuntimeAutodiscoverer.
java:205)
at org.hyperic.hq.autoinventory.ScanManager.mainRunLoop(ScanManager.java:165)
at org.hyperic.hq.autoinventory.ScanManager.access$000(ScanManager.java:41)
at org.hyperic.hq.autoinventory.ScanManager$1.run(ScanManager.java:107)
Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFa
ctory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory] at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at org.hyperic.hq.plugin.jboss.JBossUtil.getMBeanServer(JBossUtil.java:138)
at org.hyperic.hq.plugin.jboss.JBossDetector.discoverServiceTypes(JBossDetector.java:362)
... 6 more
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
... 12 more

Any ideas what could be causing this error or where I should look to toubleshoot?
Reply
0 Kudos
5 Replies
omdahk1
Contributor
Contributor

Well, I made some progress. I set the jboss.installpath in the agent.properties and recieved a different error when starting the agent:

2010-01-08 14:20:49,087 ERROR [Thread-1] [RuntimeAutodiscoverer] Unexpected error running autodiscoverer for pl
ugin: JBoss 3.2: No valid Context.PROVIDER_URL was found
org.hyperic.hq.product.PluginException: No valid Context.PROVIDER_URL was found at org.hyperic.hq.plugin.jboss.JBossDetector.discoverServiceTypes(JBossDetector.java:364)
at org.hyperic.hq.product.ServerDetector.discoverResources(ServerDetector.java:211)
at org.hyperic.hq.autoinventory.agent.server.RuntimeAutodiscoverer.doRuntimeScan_internal(RuntimeAutodi
scoverer.java:272)
at org.hyperic.hq.autoinventory.agent.server.RuntimeAutodiscoverer.doRuntimeScan(RuntimeAutodiscoverer.
java:205)
at org.hyperic.hq.autoinventory.ScanManager.mainRunLoop(ScanManager.java:165)
at org.hyperic.hq.autoinventory.ScanManager.access$000(ScanManager.java:41)
at org.hyperic.hq.autoinventory.ScanManager$1.run(ScanManager.java:107)
Caused by: javax.naming.ConfigurationException: No valid Context.PROVIDER_URL was found
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1161)

At least after this though I was able to manually add the JBoss servers to my monitor. Still don't understand what it cannot find in the original JBoss installation directories to prevent it from being auto-discovered, but at least now I can set them up manually.
Reply
0 Kudos
mcouthino
Contributor
Contributor

This solution did not work

Reply
0 Kudos
admin
Immortal
Immortal

Hi,

Run next command and attach output file:

java -jar bundles/agent-X.X.X/pdk/lib/hq-pdk-X.X.X.jar -p jboss -Dplugins.include=jboss -Dlog=debug -Djboss.user=<user> -Djboss.pass=<pass> -m discover -a metric -Djboss3.user=<user> -Djboss7.pass=<password> -Djboss3.addr=<ip> > output.log

BTW,

Why don't you upgrade your hyperic to latest version ?

Good Luck

Reply
0 Kudos
mcouthino
Contributor
Contributor

the hyperic version is 5.8.1

Reply
0 Kudos
admin
Immortal
Immortal

Hi,

Attached files is broken.

Please attach correct output file.

Reply
0 Kudos