You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dennis de Champeaux <at...@yahoo.com> on 2011/07/22 18:22:30 UTC

URL/ URI/ TC(?) puzzle -- wrong non-error?

I saw something strange on one of my virtual hosts on tomcat 6.  Not
even sure whether it is virtual host/ TC specific. 

There are only two files index.html and file2.html in this host.  The
content of file2 is irrelevant. index.html has two different links to
file2.html:
   <a href="/file2.html">file2.html</a>
   <a href="/test/file2.html">/test/file2.html</a>

Both succeed (!):
99.39.232.27 - - [01/Jul/2011:03:16:53 +0000] "GET /file2.html HTTP/1.1" 200 76
...
99.39.232.27 - - [01/Jul/2011:03:16:57 +0000] "GET /test/file2.html HTTP/1.1" 200 76
while I expected one of them to fail.

The fragment of server.xml for this virtual host:
     <Host name="www.testzzz.com"  appBase="/home/ddc/test"
           unpackWARs="true" autoDeploy="true"
           xmlValidation="false" xmlNamespaceAware="false">
       <Context path="" docBase = "/home/ddc/test/test" debug="0"
                reloadable="false" crossContext="false">
       </Context>
       ...
     </Host>

The two html files reside indeed at:
    /home/ddc/test/test/

Hence the question(s):
   URL/URI semantics allow both links to succeed?
   If not, TC6 is willing to go the extra mile?
   TC (6.0.32) is wacko?
 
----------------------------------------------------------------------------------------
Home page:                          rs6.risingnet.net/~ddcc
Health Info Anytime for Everyone:   www.HealthCheck4Me.info
Exercise for the Mind:              www.SuDoKuChallenge.us
Marketing site:                     www.OntoOO.com
>>  Do NOT buy Dell, Mac, Ford, Chrysler  <<
>>         Boycott Chinese Products       <<

Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dennis,

On 7/22/2011 12:22 PM, Dennis de Champeaux wrote:
> The fragment of server.xml for this virtual host: <Host
> name="www.testzzz.com"  appBase="/home/ddc/test" unpackWARs="true"
> autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> 
> <Context path="" docBase = "/home/ddc/test/test" debug="0" 
> reloadable="false" crossContext="false"> </Context> ... </Host>

Having a <Context> docBase set to as subdirectory of the <Host> appBase
will result in a double-deployment because:

1. <Context> specifies /home/ddc/test/test to deploy
2. <Host> autoDeploy="true" will auto-deploy "/home/ddc/test/test"
   because it is subdirectory of /home/ddc/test

You have several options:

1. Remove <Context> from server.xml and rely on your webapp's
   META-INF/context.xml file to specify any settings you might need.
   Rely on auto-deploy to deploy this context. This is safer
   for a number of reasons, and is the recommended technique.

2. Move your "test" webapp somewhere other than in the <Host> appBase.
   It would be better to use conf/[service]/[host]/[webapp].xml
   instead of putting your <Context> directly into server.xml.

3. Change <Host> to autoDeploy="false" which will stop the second
   deployment listed above. This obviously means that other contexts
   will not be auto-deployed.

4. Change the <Host> appBase to point somewhere else.

> Hence the question(s): URL/URI semantics allow both links to
> succeed?

No, this is a configuration issue, not any ambiguity in URL semantics.

> If not, TC6 is willing to go the extra mile?

No, you have a double-deployment which is why both are working.

> TC (6.0.32) is wacko?

TC is working as designed. TC is being directed to both auto-deploy the
webapp and to explicitly deploy the webapp as well.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4tiuQACgkQ9CaO5/Lv0PDaPQCeJnwS4EMfCHDdxkH7b9pYnYM7
13oAn1BU85qZOqqEEO6oQlV/bNtKHNWB
=1iHH
-----END PGP SIGNATURE-----

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


Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

Posted by David Kerber <dc...@verizon.net>.
You haven't given enough information to tell you any more detail.  Post 
the rest of your configuration files.  At a guess, you've got the same 
app deploying as ROOT and where you want it to be.  But you definitely 
have it deploying twice.

D


On 7/22/2011 6:22 PM, Dennis de Champeaux wrote:
> This is the 2nd response with 
>                       "You have a broken configuration".
> Why are you guys not explaining what is broken?
> I cannot read your mind/ Telepathy does not work here yet. 
> BTW I did do plenty of research on this topic
> Your SNOTTYness is not appreciated ....... 
>        Actually I cannot stand this list .......
> Do not tell me again that I get what I paid for ....                Ugh
>
> ----------------------------------------------------------------------------------------
> Home page:                          rs6.risingnet.net/~ddcc
> Health Info Anytime for Everyone:   www.HealthCheck4Me.info
> Exercise for the Mind:              www.SuDoKuChallenge.us
> Marketing site:                     www.OntoOO.com
>>>   Do NOT buy Dell, Mac, Ford, Chrysler<<
>>>          Boycott Chinese Products<<
>
> ________________________________
> From: Pid<pi...@pidster.com>
> To: Tomcat Users List<us...@tomcat.apache.org>
> Sent: Friday, July 22, 2011 2:47 PM
> Subject: Re: URL/ URI/ TC(?) puzzle -- wrong non-error?
>
> On 22/07/2011 22:03, Dennis de Champeaux wrote:
>> Can>>>someone  else<<<  explain what is going on ?
> You have a broken configuration and you are getting double deployment.
>
>
> p
>
>> ----------------------------------------------------------------------------------------
>>
>> ________________________________
>> From: Mark Thomas<ma...@apache.org>
>> To: Tomcat Users List<us...@tomcat.apache.org>
>> Sent: Friday, July 22, 2011 9:28 AM
>> Subject: Re: URL/ URI/ TC(?) puzzle -- wrong non-error?
>>
>> On 22/07/2011 17:22, Dennis de Champeaux wrote:
>>> Hence the question(s):
>>>       URL/URI semantics allow both links to succeed?
>>>       If not, TC6 is willing to go the extra mile?
>>>       TC (6.0.32) is wacko?
>> Nope. You have a broken configuration and you are getting double deployment.
>>
>> Mark
>>


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


Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

Posted by Mark Eggers <it...@yahoo.com>.
----- Original Message -----

> From: Dennis de Champeaux <at...@yahoo.com>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Cc: 
> Sent: Friday, July 22, 2011 3:22 PM
> Subject: Re: URL/ URI/ TC(?) puzzle -- wrong non-error?
> 
>T his is the 2nd response with 
>                      "You have a broken configuration".
> Why are you guys not explaining what is broken?
> I cannot read your mind/ Telepathy does not work here yet. 
> BTW I did do plenty of research on this topic
> Your SNOTTYness is not appreciated ....... 
>       Actually I cannot stand this list .......
> Do not tell me again that I get what I paid for ....                Ugh


As has been pointed out, your configuration is incorrect. Your
configuration leads to double deployment.

Instead guessing at what you're trying to achieve, what platform
you're running on, what exact version of Tomcat you're running, and
what JRE version you're using, I'm going to point you at some
documentation.

First of all, there's a reasonably detailed discussion on how to set
up virtual hosts in Tomcat here:

http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts

While this is designed for a development environment, it also serves
as a good basis for a production environment.

Once you have that set up, it's time to address your particular host
configuration.

According to the following documentation:

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

it is NOT RECOMMENDED to place <Context> elements directly in
server.xml

Instead, either place the context element as a file [app-name].xml in
$CATALINA_HOME/conf/[host-name] or in the application's META-INF
directory as context.xml. There are good reasons to choose one or the
other, depending on your use case. The differences are noted here:

http://tomcat.apache.org/tomcat-6.0-doc/config/host.html

under Automatic Application Deployment.

Now that you've ripped the <Context> element out of server.xml, it's
time to address the contents of this element.

Again, I will point you to:

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

as the reference.

1. There is no debug attribute
2. Don't set docBase UNLESS the application exists outside of appBase
   for the host. This is useful if you're setting up cross-context
   applications (for example, Solr). In any case do NOT set docBase as a
   subdirectory of appBase.
3. Don't set path

If you have problems once you've cleaned up your installation
according to the documentation listed above, come back with specific
questions.

I refer you to:

http://www.catb.org/~esr/faqs/smart-questions.html

as a good resource on how to ask questions on a mailing list. In
particular, it's a good idea to pay attention to the following:

http://www.catb.org/~esr/faqs/smart-questions.html#id478549

. . . . just a happy Tomcat user.

/mde/


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


Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

Posted by Pid <pi...@pidster.com>.
On 22/07/2011 23:22, Dennis de Champeaux wrote:
> BTW I did do plenty of research on this topic

Clearly not.

The erudite Mr Eggers has elucidated a full explanation, referring
therein to the primary source of information about Tomcat - the official
documentation.


p

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


Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

Posted by Mark Thomas <ma...@apache.org>.
On 22/07/2011 23:22, Dennis de Champeaux wrote:
> This is the 2nd response with 
>                      "You have a broken configuration".
> Why are you guys not explaining what is broken?

Because if you take the attitude you did in your initial post (the
question "TC (6.0.33) is wacko?" in particular) the community is
unlikely to hand you the answer on a plate. This explains things better
than I ever could:
http://www.catb.org/~esr/faqs/smart-questions.html

> I cannot read your mind/ Telepathy does not work here yet.

No need for telepathy. You have been given all the information you need
to solve this. You just need to put in a little more effort.

> BTW I did do plenty of research on this topic

Apparently not enough. Try searching the Tomcat docs for "double
deployment".

> Your SNOTTYness is not appreciated ....... 

Neither is your shouting or your attitude.

>       Actually I cannot stand this list .......

Then stop posting to it. No-one is forcing you to post here.

> Do not tell me again that I get what I paid for ....                Ugh

No-one is paying for anything here. However, when asking questions of a
community of volunteers there are a number of expectations of those
asking the questions. Generally, the less the person asking the question
meets those expectations, the less helpful the community will be.

Mark



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


Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

Posted by Pid <pi...@pidster.com>.
On 22/07/2011 23:22, Dennis de Champeaux wrote:
> Your SNOTTYness is not appreciated ....... 

By me either, but sadly there's no known cure for the common cold, but time.


p

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


Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

Posted by Dennis de Champeaux <at...@yahoo.com>.
This is the 2nd response with 
                     "You have a broken configuration".
Why are you guys not explaining what is broken?
I cannot read your mind/ Telepathy does not work here yet. 
BTW I did do plenty of research on this topic
Your SNOTTYness is not appreciated ....... 
      Actually I cannot stand this list .......
Do not tell me again that I get what I paid for ....                Ugh

----------------------------------------------------------------------------------------
Home page:                          rs6.risingnet.net/~ddcc
Health Info Anytime for Everyone:   www.HealthCheck4Me.info
Exercise for the Mind:              www.SuDoKuChallenge.us
Marketing site:                     www.OntoOO.com
>>  Do NOT buy Dell, Mac, Ford, Chrysler  <<
>>         Boycott Chinese Products       <<


________________________________
From: Pid <pi...@pidster.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Friday, July 22, 2011 2:47 PM
Subject: Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

On 22/07/2011 22:03, Dennis de Champeaux wrote:
> Can >>>someone  else<<< explain what is going on ?

You have a broken configuration and you are getting double deployment.


p

> ----------------------------------------------------------------------------------------
> 
> ________________________________
> From: Mark Thomas <ma...@apache.org>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Sent: Friday, July 22, 2011 9:28 AM
> Subject: Re: URL/ URI/ TC(?) puzzle -- wrong non-error?
> 
> On 22/07/2011 17:22, Dennis de Champeaux wrote:
>> Hence the question(s):
>>     URL/URI semantics allow both links to succeed?
>>     If not, TC6 is willing to go the extra mile?
>>     TC (6.0.32) is wacko?
> 
> Nope. You have a broken configuration and you are getting double deployment.
> 
> Mark
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


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

Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

Posted by Pid <pi...@pidster.com>.
On 22/07/2011 22:03, Dennis de Champeaux wrote:
> Can >>>someone  else<<< explain what is going on ?

You have a broken configuration and you are getting double deployment.


p

> ----------------------------------------------------------------------------------------
> 
> ________________________________
> From: Mark Thomas <ma...@apache.org>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Sent: Friday, July 22, 2011 9:28 AM
> Subject: Re: URL/ URI/ TC(?) puzzle -- wrong non-error?
> 
> On 22/07/2011 17:22, Dennis de Champeaux wrote:
>> Hence the question(s):
>>     URL/URI semantics allow both links to succeed?
>>     If not, TC6 is willing to go the extra mile?
>>     TC (6.0.32) is wacko?
> 
> Nope. You have a broken configuration and you are getting double deployment.
> 
> Mark
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


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


Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

Posted by Dennis de Champeaux <at...@yahoo.com>.
Can >>>someone  else<<< explain what is going on ?
 
----------------------------------------------------------------------------------------
Home page:                          rs6.risingnet.net/~ddcc
Health Info Anytime for Everyone:   www.HealthCheck4Me.info
Exercise for the Mind:              www.SuDoKuChallenge.us
Marketing site:                     www.OntoOO.com
>>  Do NOT buy Dell, Mac, Ford, Chrysler  <<
>>         Boycott Chinese Products       <<


________________________________
From: Mark Thomas <ma...@apache.org>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Friday, July 22, 2011 9:28 AM
Subject: Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

On 22/07/2011 17:22, Dennis de Champeaux wrote:
> Hence the question(s):
>    URL/URI semantics allow both links to succeed?
>    If not, TC6 is willing to go the extra mile?
>    TC (6.0.32) is wacko?

Nope. You have a broken configuration and you are getting double deployment.

Mark



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

Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

Posted by Mark Thomas <ma...@apache.org>.
On 22/07/2011 17:22, Dennis de Champeaux wrote:
> Hence the question(s):
>    URL/URI semantics allow both links to succeed?
>    If not, TC6 is willing to go the extra mile?
>    TC (6.0.32) is wacko?

Nope. You have a broken configuration and you are getting double deployment.

Mark



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