0

I have a java web service application, i created a .WAR file. and now i have loaded .WAR file in a folder that is in a root for example

/mytestdir/mywebapp.WAR

now i want my tomcat5 to run this file that is out of tomcat5 webapps directry. Please help me how can i run this .WAR that i should be able to access like this

http://www.mysite.com:8080/mywebapp

in .WAR file i have a code that needs to access some root level folders.

this is my first deployment.

Asghar
  • 2,336
  • 8
  • 46
  • 79

2 Answers2

2

You have to create a Tomcat Context.

In order to do so, open TOMCAT_HOME/conf/server.xml and add a Context that will point to the war file location. For example:

<Context path="/MyApplication" docBase="/mytestdir/mywebapp.WAR" reloadable="false" />

Then, restart your Tomcat instance and you're done.

Konstantin Yovkov
  • 62,134
  • 8
  • 100
  • 147
0

You should change your config.xml Smth, like this

<?xml version="1.0" encoding="UTF-8"?>
    <Context path="/mywebapp"  docBase="/mytestdir/mywebapp.WAR">

see docBase attribute

PonomarevMM
  • 452
  • 3
  • 4