tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Long (Opterus)" <>
Subject Tomcat 6 configuration using unpackWARS no longer works in Tomcat 7
Date Fri, 10 Aug 2012 19:20:34 GMT
Hi All,

I am upgrading from Tomcat 6 to Tomcat 7, and the configuration for 6 no longer works as it
did previously. I use
the <Host> ability to unpack the war file as we need access to the file system for our
application.  I also want
our application to be default web app (/) so I can simply type to access the
web app.

There is nothing in the default webapps directory.

Here are the relevant configuration snippets:

1/ In $CATALINA_BASE/conf/[enginename]/[hostname]/ I have my context file ROOT.xml, which
looks like:

<?xml version="1.0" encoding="UTF-8"?>
    reloadable="false" >
<Manager className="org.apache.catalina.session.StandardManager" pathname="" />

2/ In conf/server.xml I have:

<Host appBase="cloud/appBase" name="" unpackWARs="true" autoDeploy="false" deployOnStartup="true"
copyXML="false" deployXML="false" />

In my Tomcat 6 configuration, I actually had the .war file in a directory OUTSIDE the appBase
directory as suggested in the documentation, and Tomcat exploded it fine into a directory
called ROOT under the appBase directory.  Tomcat 7 changed it so that .war files outside the
appBase directory are no longer unpacked, which I require.

I changed it to the above configuration where the .war file is placed in the root of the appBase
directory and it is correctly unpacked.

However, what happens now is rather than unpacking it into a directory named ROOT, it unpacks
it into a directory called 'application', the initial part of the name of the war file.

The problem is that because I used the ROOT.xml context, it is configuration the default base
as /, so I end up getting a blank page if I navigate to

If I add /application/ to the request URL so it's tomcat correctly
matches the URL and displays the web app.

Is this a bug?  In order to workaround this I have to create a symbolic link called ROOT that
points the the unpacked 'application' directory.  Since tomcat
wants the symbolic link to exist when it starts, I have to do a restart after the deployment
before it works correctly.

The changes in Tomcat 7 seem to disable being able to have an unpacked web app be the default
web app.  I have tried all the combinations listed in the Wiki
to get my app to be the default web app, but none of them seem to work when the <Host>
is configured to unpack the .war file.

Any help is greatly appreciated!
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message