[Te-webmaster] the problem with starting up embedded tomcat

460416126 at qq.com
Tue Apr 12 03:22:20 CDT 2011


dear sir,
       I get a problem with starting up the embedded tomcat.I can start up embedded tmocat with that running program in local machine,but it gets exception that 'java.lang.ClassNotFoundException: org.apache.catalina.deploy.ServletDef' with launching program Web Start(jnlp).
 
       The exception details:
        ava Web Start 1.6.0_23
       JRE 1.6.0_23-b04 Java HotSpot(TM) Client VM
       2011-4-12 14:06:45 org.apache.tomcat.util.digester.Digester endElement
       error: End event threw exception
       java.lang.ClassNotFoundException: org.apache.catalina.deploy.ServletDef
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
       at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:799)
       at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201)
       at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1057)
       at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Any word in reply would be appreciated.
       ......
 
       My code:
       public static void main(String[] args) throws Exception {
        String appBase = "E:/webapps/tmpweb/";
        Integer port = 11124;
        Bootstrap bootstrap=new Bootstrap();
        Tomcat tomcat = new Tomcat();
        tomcat.setPort(port);

        tomcat.setBaseDir("E:/webapps");
        tomcat.getHost().setAppBase(appBase);
        String contextPath = "/tmpweb";
        // Add AprLifecycleListener
        StandardServer server = (StandardServer) tomcat.getServer();
        AprLifecycleListener listener = new AprLifecycleListener();
        server.addLifecycleListener(listener);
//        System.setProperty("catalina.home", ".");
        tomcat.addWebapp(contextPath, appBase);
        tomcat.start();
        tomcat.getServer().await();
    }   
  
       Your Chinese friend,
        Andy He


More information about the Te-webmaster mailing list