On 13/12/2010 13:02, Jeremy Monnet wrote:
> Hi,
> 
> I try since last friday to use a context file on tomcat 7, without any 
> success.
> 
> I have a webapp running on an old tomcat 5.0, and i want to migrate it
> to a brand new tomcat 7.0. The old tomcat was configured with a
> Catalina/localhost/myapp.xml which provides a URL like
> http://localhost:8080/myapp, for the directory webapps/MYAPP. I hav
> been unable to obtain the same behaviour on tomcat 7. I have tried to
> rename the file from myapp.xml to MYAPP.xml in the Catalina/localhost
> directory, or use a context.xml file in the directory
> webapps/MYAPP/META-INF, with no success.
> 
> old xml was :
> <?xml version='1.0' encoding='utf-8'?>
> <Context docBase="MYAPP" path="/myapp" reloadable="true" allowLinking="true" 
> />
> 
> I tried the same in the new tomcat (in which case I have "WARNING: A
> docBase /path/webapps/MYAPP inside the host appBase has been
> specified, and will be ignored" message in the logs)
> <?xml version='1.0' encoding='utf-8'?>
> <Context docBase="MYAPP" path="/myapp" reloadable="true" allowLinking="true" 
> />
> 
> and tried in webapps/MYAPP/META-INF/context.xml
> <?xml version='1.0' encoding='utf-8'?>
> <Context path="/myapp" />

Assuming a clean Tomcat 7 install then add the following content to
META-INF/context.xml inside your web app:
<?xml version='1.0' encoding='utf-8'?>
<Context reloadable="true" allowLinking="true" />

And place your webapp inside your webapps directory. The xml file will
be read from the webapp and *will not* be copied to
CATALINA_BASE/conf/Catalina/localhost

Note that if the dir/war is named MYAPP/MYAPP.war then the context path
with be /MYAPP. If you want a lower case contetx path, rename dir/war to
use lower case.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to