You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Matthias Schiffer <sc...@web.de> on 2001/06/02 09:17:56 UTC
What's wrong with this source ??
public void start_Tomcat() {
myLibPath = System.getProperty("ICCS_LIB_PATH");
File app = new File(myLibPath);
myLibPath = app.getAbsolutePath();
File app1 = new File(myLibPath);
System.setProperty("catalina.home", app1.getParent());
myTomcat = new Embedded();
Engine engine =
myTomcat.createEngine(); Host host =
myTomcat.createHost(C_CanonicalHostName,app1.getParent());
engine.addChild(host);
Context ctx =
myTomcat.createContext("",app1.getParent());
ctx.addWelcomeFile("index.html");
ctx.setDocBase(app1.getParent());
System.out.println(ctx.getDocBase() + " , " +
ctx.getPath());
host.addChild(ctx);
myTomcat.addEngine(engine);
Connector connector = null ;
myTomcat.setUseNaming(true) ;
try{
connector =
myTomcat.createConnector(InetAddress.getLocalHost(),8080,false);
}catch(UnknownHostException uhe) {
System.out.println("Exception: " + uhe);
}
myTomcat.addConnector(connector);
try{
myTomcat.start();
}catch(LifecycleException lce) {
System.out.println("Exception: " + lce);
}
So, when you read this source, I think the DocBase is the directory
where Tomcat searches for HTML files, but it does not although it is
listening..
What further do I have to set ?? Please Help Me. Thanks!