Hi,
I'm trying to access a JBoss datasource via JMX but this fails because of a classnotfoundexception.
The JMX code and datasource code is both placed inside a WAR file that is deployed in Jboss 5.1.
When I access the datasource from a servlet, it runs oke but when I try to run it from jconsole I get a classnotfoundexception.
The code where I register the MBean is:
java Code:
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
try
{
ObjectName mbeanName = new ObjectName(OBJECT_NAME);
Test mbean = new Test();
mbs.registerMBean(mbean, mbeanName);
}
catch (Exception e)
{
//handle
}
The code where I get the exception is:
Context initContext = new InitialContext(jndiProps);
The exception is:
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
These are my JNDI props:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming
rg.jnp.interfaces
java.naming.provider.url=jnp://localhost:1099
Any ideas?