tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Smirnoff" <alex...@trillint.com>
Subject Problem with WebApp Classloader using remote Jmx initialization of the Web module.
Date Sun, 29 Aug 2004 12:57:02 GMT
I'm trying to create the WebAppContext remotely with JMX (Tomcat 5.0.27, JDK
1.5)and doing something like this:

public void deployApplication(String context, String path) throws
CoreException {
  init();
  try {
   ObjectName webmodule =
         new
ObjectName(DOMAIN+":j2eetype=WebModule,name=//localhost/"+context+",J2EEAppl
ication=none,J2EEServer=none");
   mbsc.createMBean("org.apache.commons.modeler.BaseModelMBean", webmodule,
     new Object[] {"org.apache.catalina.core.StandardContext"}, new String[]
{"java.lang.String"});
   mbsc.setAttribute(webmodule, new Attribute("docBase", path));
   mbsc.setAttribute(webmodule, new Attribute("defaultWebXml", "web.xml"));
   mbsc.setAttribute(webmodule, new Attribute("engineName", DOMAIN));
   mbsc.setAttribute(webmodule, new Attribute("delegate", new
Boolean(true)));
   mbsc.invoke(webmodule, "init", new Object[] {}, new String[] {});
   //mbsc.invoke(webmodule, "start", new Object[] {}, new String[] {});
  } catch (Throwable e){
   throw new CoreException(new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID,
IStatus.ERROR, "Cannot create the application context for "+context, e));
  }
 }

This code initialize, but does not starting the WebContext. When I force the
startup from JConsole it fails on NoClassDefFoundError. The class it fails
to find is in WEB-INF/lib directory.

I see that the classloader is initialized as well. But I'm not sure how to
assing it to Web App module.

Do I have to explicitly set loader atribute?

Thanks,
Alex.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message