tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Ee" <and...@sysatwork.com>
Subject Multi-Level Context Paths
Date Mon, 17 Aug 2009 10:44:57 GMT
 

Dear All,

 

I need an urgent help, and I hope you will shed some light to it.

 

I have recently installed Apache Tomcat version 6.0.20. I copied my project
file (test.war) under /usr/local/apache-tomcat-6.0.20/webapps/ and it
deployed successfully. I can access the site via the URL of
<http://localhost:8080/ms3/> http://localhost:8080/test/. For this example,
the context path simply follows the filename of the war file.

 

There is a new requirement to setup multi-level context path as in I need
the URL to be  <http://localhost:8080/sg/server/test/>
http://localhost:8080/sg/server/test/ instead. I read up your site and
confirmed that adding Context path within server.xml is not recommended. I
went ahead to make a copy of the existing test.xml to sg#server#test.xml
under /usr/local/apache-tomcat-6.0.20/conf/Catalina/localhost/. Then I
restarted Tomcat.

 

The content of sg#server#test is:

 

<Context path="/test" debug="99" reloadable="true"

    antiJARLocking="true" antiResourceLocking="false">

 

    <!--Resource name="jdbc/test" auth="Container"
type="javax.sql.DataSource"

              maxActive="100" maxIdle="30" maxWait="10000"

              driverClassName="oracle.jdbc.driver.OracleDriver"

              username="MS3_STL" password="password"

              url="jdbc:oracle:thin:@192.168.0.37:1521:MS3"

              defaultAutoCommit="true" removeAbandoned="true"

              removeAbandonedTimeout="60" logAbandoned="true"/-->

</Context>

 

I restarted Tomcat but it gives errors under Catalina.out

 

Aug 17, 2009 5:54:43 PM org.apache.catalina.core.StandardContext
resourcesStart

SEVERE: Error starting static Resources

java.lang.IllegalArgumentException: Document base
/usr/local/apache-tomcat/webapps/sg#server#test does not exist or is not a
readable directory

        at
org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:14
2)

        at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java
:4048)

        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4217)

        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7
91)

        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)

        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)

        at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)

        at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556
)

        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)

        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)

        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)

        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:119)

        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:722)

        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

        at
org.apache.catalina.core.StandardService.start(StandardService.java:516)

        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

        at org.apache.catalina.startup.Catalina.start(Catalina.java:583)

        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:597)

        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

Aug 17, 2009 5:54:43 PM org.apache.catalina.core.StandardContext start

SEVERE: Error in resourceStart()

Aug 17, 2009 5:54:43 PM org.apache.catalina.core.StandardContext start

SEVERE: Error getConfigured

Aug 17, 2009 5:54:43 PM org.apache.catalina.core.StandardContext start

SEVERE: Context [/sg/server/test] startup failed due to previous errors

Aug 17, 2009 5:54:43 PM org.apache.catalina.core.StandardContext stop

INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/sg/server/te
st] has not been started

Aug 17, 2009 5:54:43 PM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-6060

Aug 17, 2009 5:54:43 PM org.apache.coyote.http11.Http11Protocol start

INFO: Starting Coyote HTTP/1.1 on http-6443

Aug 17, 2009 5:54:43 PM org.apache.jk.common.ChannelSocket init

INFO: JK: ajp13 listening on /0.0.0.0:6009

Aug 17, 2009 5:54:43 PM org.apache.jk.server.JkMain start

INFO: Jk running ID=0 time=0/40  config=null

Aug 17, 2009 5:54:43 PM org.apache.catalina.startup.Catalina start

INFO: Server startup in 18859 ms

 

I have searched the Internet and couldn't find any posts with solutions to
such issue. It seems that setting up multi-level context path in Tomcat 6 is
not so straight-forwarded.

 

Please kindly help, thanks.

 

Best Regards,
Andy Ee



 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message