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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]