Re: Problem on Tomcat 6.0.20

2010-02-02 Thread Richard Sickler
On Mon, Feb 1, 2010 at 7:12 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Richard Sickler [mailto:richard.sick...@avagotech.com]
  Subject: Problem on Tomcat 6.0.20
 
  when I copy the war, (WebApplication2.war) to
  c:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps
  on my Windows Server 2008 machine, and rename it to ROOT.war

 Unless Tomcat is stopped, this is not good practice.  You first make then
 webapp visible to Tomcat as WebApplication2, then make that disappear and
 materialize the ROOT webapp.  Better to do the renaming as part of the copy
 to avoid confusing the container or make sure Tomcat is not running.

  Feb 1, 2010 6:33:14 PM org.apache.catalina.core.StandardContext
  resourcesStart
  SEVERE: Error starting static Resources
  java.lang.IllegalArgumentException: Document base
  C:\Program Files\Apache Software Foundation\
  Tomcat 6.0\webapps\WebApplication2 does not exist
  or is not a readable directory

 You may well have a WebApplication2.xml file in the conf/Catalina/[host]
 directory, left over from a previous deployment attempt.  Check for that and
 delete it.


You were correct.  I removed a file and a directory named WebApplication2,
and that cleared up that problem.  On to the next undocumented feature!
Thanks.


  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you received
 this in error, please contact the sender and delete the e-mail and its
 attachments from all computers.


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




RE: Problem on Tomcat 6.0.20

2010-02-02 Thread Caldarale, Charles R
 From: Richard Sickler [mailto:richard.sick...@avagotech.com]
 Subject: Re: Problem on Tomcat 6.0.20
 
 I removed a file and a directory named WebApplication2, and that
 cleared up that problem.  On to the next undocumented feature!

It's fully documented:

Context elements may be explicitly defined:
...
* In individual files (with a .xml extension) in the 
$CATALINA_BASE/conf/[enginename]/[hostname]/ directory. The name of the file 
(less the .xml extension) will be used as the context path. Multi-level context 
paths may be defined using #, e.g. foo#bar.xml for a context path of /foo/bar. 
The default web application may be defined by using a file called ROOT.xml.
* Only if a context file does not exist for the application in the 
$CATALINA_BASE/conf/[enginename]/[hostname]/, in an individual file at 
/META-INF/context.xml inside the application files. If the web application is 
packaged as a WAR then /META-INF/context.xml will be copied to 
$CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to match the 
application's context path. Once this file exists, it will not be replaced if a 
new WAR with a newer /META-INF/context.xml is placed in the host's appBase.

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

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: Problem on Tomcat 6.0.20

2010-02-02 Thread Dan Armbrust
On Tue, Feb 2, 2010 at 3:23 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Richard Sickler [mailto:richard.sick...@avagotech.com]
 Subject: Re: Problem on Tomcat 6.0.20

 I removed a file and a directory named WebApplication2, and that
 cleared up that problem.  On to the next undocumented feature!

 It's fully documented:

 Context elements may be explicitly defined:
 ...
    * ... If the web application is packaged as a WAR then 
 /META-INF/context.xml will be copied to 
 $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to match the 
 application's context path. Once this file exists, it will not be replaced if 
 a new WAR with a newer /META-INF/context.xml is placed in the host's appBase.


Documented, yes.  Astonishingly silly and surprising behaviour?  Also yes.

Good luck getting them to improve it.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45979
https://issues.apache.org/bugzilla/show_bug.cgi?id=32284

Near as I can tell, this surprising and bizarre behaviour occurs
because Remy likes it that way.

In my opinion, Tomcat should remember if it copied the file out of a
war file... and if the war file is replaced, it should overwrite the
file with the new file from the new war file.

Is it trivial?  Not exactly, Tomcat would have to somehow keep track
of if the file was manually modified or not... but really, it just
needs to keep a hash of the file somewhere so it can check if the file
has been changed since it put it there.

I think Tomcat should also log a warning message when it doesn't copy
a context.xml from a war file... because the developer has made a
mistake at this point - someone manually changed one version, but
didn't change the one in the war file.

The current design leads to people having problems like you have -
because beginning developers aren't (and really) shouldn't have to be
aware of this nasty gotcha of Tomcat.

Dan

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



Re: Problem on Tomcat 6.0.20

2010-02-02 Thread Mark Thomas
On 02/02/2010 22:57, Dan Armbrust wrote:
 On Tue, Feb 2, 2010 at 3:23 PM, Caldarale, Charles R
 chuck.caldar...@unisys.com wrote:
 From: Richard Sickler [mailto:richard.sick...@avagotech.com]
 Subject: Re: Problem on Tomcat 6.0.20

 I removed a file and a directory named WebApplication2, and that
 cleared up that problem.  On to the next undocumented feature!

 It's fully documented:

 Context elements may be explicitly defined:
 ...
* ... If the web application is packaged as a WAR then 
 /META-INF/context.xml will be copied to 
 $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to match the 
 application's context path. Once this file exists, it will not be replaced 
 if a new WAR with a newer /META-INF/context.xml is placed in the host's 
 appBase.

 
 Documented, yes.  Astonishingly silly and surprising behaviour?  Also yes.
 
 Good luck getting them to improve it.
 https://issues.apache.org/bugzilla/show_bug.cgi?id=45979
 https://issues.apache.org/bugzilla/show_bug.cgi?id=32284
 
 Near as I can tell, this surprising and bizarre behaviour occurs
 because Remy likes it that way.
 
 In my opinion, Tomcat should remember if it copied the file out of a
 war file... and if the war file is replaced, it should overwrite the
 file with the new file from the new war file.

There are two opposing opinions on what is the correct behaviour here.
That is one, the other is that if I want to edit the context.xml Tomcat
should a) make this easy so I don't have to muck about with the WAR and
b) not overwrite my changes.

 Is it trivial?  Not exactly, Tomcat would have to somehow keep track
 of if the file was manually modified or not... but really, it just
 needs to keep a hash of the file somewhere so it can check if the file
 has been changed since it put it there.

The simpler solution is just not to expand it. Tomcat doesn't need to
expand it to read it.

 I think Tomcat should also log a warning message when it doesn't copy
 a context.xml from a war file... because the developer has made a
 mistake at this point - someone manually changed one version, but
 didn't change the one in the war file.

That is a good idea for an enhancement. As ever, patches welcome.

 The current design leads to people having problems like you have -
 because beginning developers aren't (and really) shouldn't have to be
 aware of this nasty gotcha of Tomcat.

And overwriting an edited context.xml has similar gotchas.

One idea I have seen proposed in the past is to make the extraction of
context.xml configurable per host. That should be fairly simple. Again,
patches welcome.

I've added https://issues.apache.org/bugzilla/show_bug.cgi?id=48662 to
track these ideas. Feel free to add to that.

Mark

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



RE: Problem on Tomcat 6.0.20

2010-02-01 Thread Caldarale, Charles R
 From: Richard Sickler [mailto:richard.sick...@avagotech.com]
 Subject: Problem on Tomcat 6.0.20
 
 when I copy the war, (WebApplication2.war) to
 c:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps
 on my Windows Server 2008 machine, and rename it to ROOT.war

Unless Tomcat is stopped, this is not good practice.  You first make then 
webapp visible to Tomcat as WebApplication2, then make that disappear and 
materialize the ROOT webapp.  Better to do the renaming as part of the copy to 
avoid confusing the container or make sure Tomcat is not running.
 
 Feb 1, 2010 6:33:14 PM org.apache.catalina.core.StandardContext
 resourcesStart
 SEVERE: Error starting static Resources
 java.lang.IllegalArgumentException: Document base 
 C:\Program Files\Apache Software Foundation\
 Tomcat 6.0\webapps\WebApplication2 does not exist
 or is not a readable directory

You may well have a WebApplication2.xml file in the conf/Catalina/[host] 
directory, left over from a previous deployment attempt.  Check for that and 
delete it.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



RE: problem on TOMCAT 6.0.20: no access to manager pages

2009-11-13 Thread Caldarale, Charles R
 From: Marie-Christine Lagasquie [mailto:lagasq...@free.fr]
 Subject: problem on TOMCAT 6.0.20: no access to manager pages
 
 tomcat-users
 !--
   role rolename=tomcat/
   role rolename=role1/
   role rolename=manager/
   role rolename=admin/
   user username=tomcat password=tomcat roles=tomcat/
   user username=both password=tomcat roles=tomcat,role1/
   user username=role1 password=tomcat roles=role1/
   user username=chef password=chtomcat roles=manager,admin/
 --
 /tomcat-users

Quick XML test: what do the tokens !-- and -- mean?  (Hint: think /* 
and */.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



Re: problem on TOMCAT 6.0.20: no access to manager pages

2009-11-13 Thread Pid

On 13/11/2009 15:29, Marie-Christine Lagasquie wrote:

Hello

I am trying to install TOMCAT 6.0.20 on linux (ubuntu 9.10, karmic
distribution) and the following pb occurs :

   I cannot access to manager pages


I use the archive file given on the page
http://tomcat.apache.org/download-60.cgi#6.0.20
and I obtain the file apache-tomcat-6.0.20.tar.gz


After installation, Tomcat runs with :

Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:   /usr/lib/jvm/java-6-sun-1.6.0.16/

Of course, the file /usr/local/tomcat/conf/tomcat-users.xml has been
modified before running Tomcat and now contains :
---
tomcat-users
!--


^ comment


   role rolename=tomcat/
   role rolename=role1/
   role rolename=manager/
   role rolename=admin/
   user username=tomcat password=tomcat roles=tomcat/
   user username=both password=tomcat roles=tomcat,role1/
   user username=role1 password=tomcat roles=role1/
   user username=chef password=chtomcat roles=manager,admin/
--


^ comment

Remove the comments to enable the elements in the file.


p



/tomcat-users


No other files have been modified.
--

With mozilla firefox (version 3.5.5), the connection on
http://localhost:8080/ is OK : I obtain the Apache tomcat page with some
links to documentation, examples and so.
The great majority of these links is OK except the administration links:

  When I try to follow the link status (or Tomcat manager),
1. the window for authentification is opened
2. I give the login chef and the password chtomcat
3. and ... the window for authentification is cleared and reopened
4. and so on (I never access the manager pages)!!
 If I cancel the window, an error 401 Unauthorized occurs.


Could you help me, please?
MCL






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



Re: problem on TOMCAT 6.0.20: no access to manager pages

2009-11-13 Thread Tobias Crefeld
Am Fri, 13 Nov 2009 16:29:22 +0100
schrieb Marie-Christine Lagasquie lagasq...@free.fr:

 Of course, the file /usr/local/tomcat/conf/tomcat-users.xml has been
 modified before running Tomcat and now contains :
 ---
 tomcat-users

This is the start of a comment:
 !--

   role rolename=tomcat/
   role rolename=role1/
   role rolename=manager/
   role rolename=admin/
   user username=tomcat password=tomcat roles=tomcat/
   user username=both password=tomcat roles=tomcat,role1/
   user username=role1 password=tomcat roles=role1/
   user username=chef password=chtomcat roles=manager,admin/

..and this the end:
 --

 /tomcat-users


BTW: If the system can be accessed from the www you should leave out the
standard-users tomcat, both and role1.


RU,
 Tobias.

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



Re: problem on TOMCAT 6.0.20: no access to manager pages

2009-11-13 Thread André Warnier

Marie-Christine Lagasquie wrote:

Hello


Marie-Christine, I will make a bet :
In part because of your name, but mainly because this is the most-loved 
problem for the gurus on this forum, you are going to get, within the 
next few minutes at least 3 answers all pointing out to you, in minute 
detail, where the problem is.

























Ok, I cheated. I saw the first answers before I wrote this..
;-)

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