I'm trying to create an MBean from within a Servlet with Tomcat 4.1.10 and I keep 
getting a ClassNotFoundException. The class in question is in the classpath and it's 
visible from the Servlet trying make the createMBean call. I've tried putting the the 
jar which has the MBean .class file in these places:
  a.. webapps/webapp_name/web-inf/lib
  b.. shared/lib
  c.. common/lib
None of them worked. Creating this same MBean worked fine in Tomcat 4.0.x when I 
included the jmxri.jar in the webapp classpath.

Does anyone know how to modify the classpath used by the JMX component of Tomcat 4.1.x?

Here's the log entry showing the exception:
2002-09-17 17:33:23 agent: AgentServlet init()2002-09-17 17:33:24 agent: initalizing 
local server instance: mx4j.server.MBeanServerImpl@1a611722002-09-17 17:33:24 agent: 
OBJECT NAME: Adaptor:name=html,port=80832002-09-17 17:33:24 agent: OBJECT NAME: 
MBeanInfo:name=SimpleStandard2002-09-17 17:33:24 agent: MBean class: class 
org.jfa.example.SimpleStandard2002-09-17 17:33:24 agent:  !!! Could not create the 
HTML adaptor !!!2002-09-17 17:33:24 javax.management.ReflectionException: nested 
exception is java.lang.ClassNotFoundException: 
org.jfa.example.SimpleStandardjava.lang.ClassNotFoundException: 
org.jfa.example.SimpleStandard at 
mx4j.server.DefaultClassLoaderRepository.loadClassWithout(DefaultClassLoaderRepository.java:43)
 at 
mx4j.server.DefaultClassLoaderRepository.loadClass(DefaultClassLoaderRepository.java:26)
 at mx4j.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:464) at 
mx4j.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:456) at 
org.jfa.example.AgentServlet.doInit(Unknown Source) at 
org.jfa.example.AgentServlet.init(Unknown Source) at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:924) at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813) at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3342) at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:3534) at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at 
org.apache.catalina.core.StandardHost.start(StandardHost.java:738) at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347) at 
org.apache.catalina.core.StandardService.start(StandardService.java:497) at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:2191) at 
org.apache.catalina.startup.Catalina.start(Catalina.java:510) at 
org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at 
org.apache.catalina.startup.Catalina.process(Catalina.java:180) at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:324) at 
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

Reply via email to