aspose file tools*
The moose likes Tomcat and the fly likes Tomcat is unable to detect web.xml from WAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat is unable to detect web.xml from WAR" Watch "Tomcat is unable to detect web.xml from WAR" New topic
Author

Tomcat is unable to detect web.xml from WAR

Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
I created a ware file and following is the contents of the war file.
It just has a Servlet and a index.html file.
D:\myapp>jar -tf kar.war
META-INF/
META-INF/MANIFEST.MF
index.html
web-inf/
web-inf/classes/
web-inf/classes/pack/
web-inf/classes/pack/HelloServlet.class
web-inf/classes/pack/HelloServlet.java
web-inf/web.xml

I copied it to the webapps directory.
When i start tomcat it is able to extract the war file and i see the directory structure as well.
But while adding the web application it complains about web.xml file.
BUT i can see the web.xml file in
D:\Apache Tomcat 4.0\webapps\kar\web-inf
directory.
This is the trace..
2002-03-16 13:01:19 StandardHost[localhost]: Installing web application at context path /kar from URL jar:file :\Apache Tomcat 4.0\webapps\kar.war!/
2002-03-16 13:01:19 WebappLoader[/kar]: Deploying class repositories to work directory D:\Apache Tomcat 4.0\work\localhost\kar
2002-03-16 13:01:19 StandardManager[/kar]: Seeding random number generator class java.security.SecureRandom
2002-03-16 13:01:19 StandardManager[/kar]: Seeding of random number generator has been completed
2002-03-16 13:01:19 ContextConfig[/kar]: Missing application web.xml, using defaults only
2002-03-16 13:01:19 StandardWrapper[/kar efault]: Loading container servlet default
2002-03-16 13:01:19 default: init
2002-03-16 13:01:19 StandardWrapper[/kar:invoker]: Loading container servlet invoker
2002-03-16 13:01:19 invoker: init
2002-03-16 13:01:19 jsp: init
2002-03-16 13:01:19 Internal Error: File /WEB-INF/web.xml not found
2002-03-16 13:01:19 StandardContext[/kar]: Servlet /kar threw load() exception
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

WEB-INF must be in all caps, and yours is in lower case.
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Originally posted by Mike Curwen:
WEB-INF must be in all caps, and yours is in lower case.

thanks! it works now.
raja ramanamurthy
Greenhorn

Joined: Sep 05, 2003
Posts: 1
Hi! I have the same error as yours although WEB-INF is in capitals...Kindly help to solve it...Here's the trace..
Thanks,
Raja

2003-09-05 17:06:12 WebappLoader[/test_struts]: Deploying class repositories to work directory C:\Tomcat 4.1\work\Standalone\localhost\test_struts
2003-09-05 17:06:12 WebappLoader[/test_struts]: Reloading checks are enabled for this Context
2003-09-05 17:06:12 ContextConfig[/test_struts]: Missing application web.xml, using defaults only
2003-09-05 17:06:12 StandardManager[/test_struts]: Seeding random number generator class java.security.SecureRandom
2003-09-05 17:06:12 StandardManager[/test_struts]: Seeding of random number generator has been completed
2003-09-05 17:06:12 StandardWrapper[/test_struts efault]: Loading container servlet default
2003-09-05 17:06:12 StandardWrapper[/test_struts:invoker]: Loading container servlet invoker
Missing application web.xml
 
jQuery in Action, 2nd edition
 
subject: Tomcat is unable to detect web.xml from WAR