Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat is unable to detect web.xml from WAR

 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WEB-INF must be in all caps, and yours is in lower case.
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic