tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siping Liu" <s...@egenera.com>
Subject HELP: why StandardContext.start() coded this way?
Date Fri, 02 May 2003 14:48:53 GMT
Hi,

In tomcat-4.1.24, I copied my xxx.war file to webapps but didn't create
webapps/xxx direcotry. After Tomcat start up, I see my war
file get expanded but got this error in logs/xxx_log.2003-05-02.txt
file:

2003-05-02 09:09:23 StandardContext[]: Resources start failed:
java.lang.IllegalArgumentException: Document base
../jakarta-tomcat-4.1/webapps/xxx does not exist or is not a readable
directory
	at
org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:19
3)
	at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java
:3342)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3472)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
	at org.apache.catalina.core.StandardService.start(StandardService.java:497)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
	at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
	at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

And also accessing my application from browser resulted in 404 error.

My question -- why in following code (cut from StandardContext.start()
method)
the resourceStart() is called before setLoader()? Looks like my problem was
caused by
resourceStart() checking the existance of my app directory before the
directory
was created by setLoader().

if (ok) {
    if (!resourcesStart())
        ok = false;
}
if (getLoader() == null) {      // (2) Required by Manager
    if (getPrivileged()) {
        if (debug >= 1)
            log("Configuring privileged default Loader");
        setLoader(new WebappLoader(this.getClass().getClassLoader()));
    } else {
        if (debug >= 1)
            log("Configuring non-privileged default Loader");
        setLoader(new WebappLoader(getParentClassLoader()));
    }
}

Thanks,
SL


---------------------------------------------------------------------
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