Hi,
This is my server details:-

Server InformationTomcat VersionJVM VersionJVM VendorOS NameOS VersionOS
ArchitectureHostnameIP AddressApache Tomcat/8.0.281.7.0_51-b13Oracle
CorporationMac OS X10.9.5x86_64
I have a web application(mytomcat-helloworld) in below
directory /Library/Tomcat/apache-tomcat-8.0.28/webapps/
Server.xml is also out of box.
 <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

I can access my application at below url:-
http://localhost:8080/mytomcat-helloworld/
Everything is fine till here.

I have now created a context xml in path
/Library/Tomcat/apache-tomcat-8.0.28/conf/Catalina/localhost/test.xml
as
<Context path = "/test" docBase="mytomcat-helloworld" >
</Context>

I was hoping to access the application with url:-
http://localhost:8080/test

But instead I get this error:-
18-Oct-2015 17:41:05.994 INFO [localhost-startStop-7]
org.apache.catalina.startup.HostConfig.deployDescriptor Deploying
configuration descriptor
/Library/Tomcat/apache-tomcat-8.0.28/conf/Catalina/localhost/test.xml
18-Oct-2015 17:41:05.995 WARNING [localhost-startStop-7]
org.apache.catalina.startup.HostConfig.deployDescriptor A docBase
/Library/Tomcat/apache-tomcat-8.0.28/webapps/mytomcat-helloworld inside the
host appBase has been specified, and will be ignored
18-Oct-2015 17:41:06.000 SEVERE [localhost-startStop-7]
org.apache.catalina.core.ContainerBase.addChildInternal
ContainerBase.addChild: start:
 org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/test]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:586)
at
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1780)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.catalina.LifecycleException: Failed to start
component [org.apache.catalina.webresources.StandardRoot@5334f6e8]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4854)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4984)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: java.lang.IllegalArgumentException: The main resource set
specified [/Library/Tomcat/apache-tomcat-8.0.28/webapps/test] is not valid
at
org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:723)
at
org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:684)
at org.apache.catalina.ut


I have followed the specs given here:-
http://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Defining_a_context

Note:- I get the error with this xml as well
<Context  docBase="mytomcat-helloworld" >
</Context>

Reply via email to