tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Wannamaker <Ke...@Apache.org>
Subject launching tomcat from java
Date Wed, 03 Nov 2004 18:37:45 GMT
What needs to be done to launch tomcat via reflection?
jdk1.4 gives me java.lang.NoClassDefFoundError: 
javax/management/MBeanRegistration.

Why does jmx have to be in the bootstrap loader?

     System.setProperty("catalina.home", l_catalinaHome.getAbsolutePath());

     URL urls[] = new URL[] {
       new File(base, STANDALONE_BIN + "jmx.jar").toURL(),
       new File(base, STANDALONE_BIN + "bootstrap.jar").toURL(),
       new File(base, STANDALONE_BIN + "commons-logging-api.jar").toURL()
       };
     URLClassLoader ucl = new URLClassLoader(urls, null);

       Class c = ucl.loadClass(className);
       Method main = c.getDeclaredMethod("main", new Class[] 
{String[].class}
  );
       Object argslist[] = new Object[1];
       argslist[0] = new String[] { "stop" };
       Object ret = main.invoke(null, argslist);

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


Mime
View raw message