Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

web.xml not found in .war file

Status
Not open for further replies.

dvollberg

Programmer
Feb 23, 2004
2
US
I am trying to load a set of web pages and servlets using a .war file generated by Ant. I have it setup to automatically install new .war files when it detects them while I am still developing the site. Every once in a while I will get a message saying "INFO: Missing application web.xml, using defaults only StandardEngine[Catalina].StandardHost[localhost].StandardContext[/LandmarkServlets]". Once I start getting that I have to play around with it, recompile a few times and reset tomcat. At some point it will suddenly be able to find it again just fine even though I haven't changed the file structure in the .war file. This is problem appears to have no pattern. Has anyone ever encountered anything like this or have any idea how to fix this so my .war loads properly.

One thing I have noted is that the web.xml file has an archived path of ./web-xml/ in the .war file, even though it is in ./WEB-XML/ in the build path for Ant. I don't know why it is putting it in an all lower case directory when it is coming out of an all upper case path.

Thanks,
Dave
 
Check that the web.xml is in context/WEB-INF directory. Can you post the ant build.xml file that copies the web.xml to the build directory ...
 
I'm using the following build script( note it is a development script so it points to my jbuilder project and directly into the tomcat webapps directory so I can debug faster)

build.xml
<project name="Servlets" default="dist" basedir="..">
<description>
...
</description>
<property name="app_name" value="Servlets"/>
<property name="dest" location="WEB-INF/classes"/>
<property name="lib" location="WEB-INF/lib"/>
<property name="src" location="../../../jbproject/Servlets/src"/>
<property name="build" location="build"/>
<property name="catalina_home" location="../../../../../Program Files/Apache Software Foundation/Tomcat 5.0"/>
<target name="init">
<tstamp/>
</target>
<target name="build" depends="init">
<javac srcdir="${src}" destdir="${dest}" debug="on">
<classpath>
<fileset dir="${catalina_home}/common/lib/">
<include name="*.jar"/>
</fileset>
<fileset dir="${catalina_home}/server/lib/">
<include name="*.jar"/>
</fileset>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="dist" depends="build">
<jar jarfile="../../../../../Program Files/Apache Software Foundation/Tomcat 5.0/webapps/${app_name}.war">
<fileset dir=".">
<exclude name="src/**"/>
<exclude name="build/**"/>
<exclude name="docs/**"/>
</fileset>
</jar>
</target>
<target name="clean" description="Clean Up">
<delete dir="${dest}/com"/>
</target>
</project>

I have put the web.xml file in ./WEB-INF/ relative to where I run Ant.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top