-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maik,

Please keep conversations on the list. I'm cc'ing the list in my reply.

Maik Schumacher wrote:
> My goal is to access the Web application ‚testweb.war‘ on Tomcat 6.0.18
> using Windows here with:
> 
> http://localhost:8080
> 
> and not with
> 
> http://localhost:8080/testweb

The easiest possible thing is to put your application under your
<Host>'s app base and call it ROOT.war (or use a directory called ROOT).

> As you recommended I changed the ‚appBase‘ attribute in the ‚server.xml‘
> pointing to 'c:/test/www' on Windows.

I don't believe I suggested that you change to appBase to match the
place where you put your webapp. Use of appBase + webapps results in
auto-deployment of those webapps, which is /not/ what you want. Instead,
you want your WAR file (or directory) to be separate from any
auto-deployment directory because you are attempting to do a custom
deployment.

What you want is this:

<Host appBase="/the/normal/Tomcat/auto-deploy/directory">

Then, put your testweb.war file wherever you want and put this into your
conf/Catalina/localhost/ROOT.xml:

<Context docBase="/path/to/testweb.war">

> I put the Web application as a WAR file with the name' testweb.war' in
> 'c:/test/www'

This will result in your webapp being auto-deployed to /testweb which, I
think, isn't what you want.

> I created a ROOT.xml in <tomcat>/Catalina/localhost with this content:
> 
> <Context path="testweb" reloadable="true"/>

This is illegal and stupid. It is illegal because the docs say it is
(see below). It is stupid because path="testweb" would deploy your
webapp to /testweb instead of / if it worked, which it won't.

Please read:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

Regarding the "path" attribute:

"
The value of this field must not be set except when statically defining
a Context in server.xml, as it will be inferred from the filenames used
for either the .xml context file or the docBase.
"

> Now I start Tomcat and get this error:
> 
> java.lang.IllegalArgumentException: Document base c:/Temp/www/ROOT does
> not exist or is not a readable directory

Does your Tomcat have permissions to access c:\temp\www\ROOT? I thought
you were running on Linux...

> Is this a limitation of Tomcat or do I something wrong here?

Tomcat is not limited in the way you suggest. Your configuration is
simple if you do one of the following:

1. Just name your application ROOT.war and stick it in your
auto-deployment directory (default is 'webapps' in the Tomcat
installation directory).

2. Put your WAR file somewhere outside the auto-deployment directory and
create a conf/Catalina/localhost/ROOT.xml with a docBase pointing to the
absolute pathname to your WAR file. DO NOT DEFINE A 'path' ATTRIBUTE IN
YOUR CONTEXT.XML.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkj3ZtgACgkQ9CaO5/Lv0PBl8wCgtIxBuMxrUqAdyd9ITw+Yqz4C
elwAoKD/IFrELypbgMvIICctEQAWUtDe
=9SD3
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to