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:
  1. MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
  2. try
  3. {
  4. ObjectName mbeanName = new ObjectName(OBJECT_NAME);
  5. Test mbean = new Test();
  6. mbs.registerMBean(mbean, mbeanName);
  7. }
  8. catch (Exception e)
  9. {
  10. //handle
  11. }
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.namingrg.jnp.interfaces
java.naming.provider.url=jnp://localhost:1099

Any ideas?