RE: tomcat error 404

2011-10-21 Thread Caldarale, Charles R
> From: Dave Filchak [mailto:sub...@zuka.net] 
> Subject: tomcat error 404

> I am receiving a HTTP Status 404 error.

Can you tell if the 404 is coming from Tomcat or httpd?

> I have verified that tomcat and apache are running.

By "apache" [sic], I presume you mean httpd.  How did you verify they're 
running?

> My host will now help

So if the host will help, why aren't you asking them?  (Or did you really mean 
"not" there?)

> If anyone can help me I really would appreciate it as the 
> site is down completely at this point.

Without considerably more information, there's not much anyone can help you 
with.  For starters, you need to examine the logs, post your server.xml file 
(obfuscated as needed), show us the  element (if there is one) for 
your webapp, tell us the mechanism you're using to connect httpd to Tomcat, and 
provide the config for that.

 - 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



tomcat error 404

2011-10-21 Thread Dave Filchak

Folks, I know I have asked about this site befor with a number of
problems and one of the suggestions was to find the original programmer
for help. Well I cannot find him ... he is not available unfortunately.
I was originally getting some except errors but now, after my host
"turned off" my server because I was three days late in paying an
invoice, I am receiving a HTTP Status 404 error. I have verified that
tomcat and apache are running. My host will now help ( pissed about that
) so I am hoping someone can help be fix this. I am NOT a tomcat person
and I do not actually think this app is set up in what I understand to
be a normal way.

If anyone can help me I really would appreciate it as the site is down
completely at this point.

Server CentOS
Tomcat 5.5.33
Apache 2.2.19

thank you in advance

Dave


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



Re: Tomcat application startup - Lifecycleexception

2011-10-21 Thread Pid
On 21/10/2011 00:26, ramsri wrote:
> I now know that there is no longer a need to mess around with setclasspath.sh.

I'm not sure there ever was.


p



signature.asc
Description: OpenPGP digital signature


Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread André Warnier

Mark Thomas wrote:
...



Of course in all this, my basic assumption is that currently, Tomcat
keeps session information (including the expiration data) in some
location which requires an I/O action to access.



That assumption is incorrect. Which pretty much invalidates the rest of
the points below.

Again, I *strongly* encourage you to look at the current implementation
before suggesting improvements.


...



In a case like this one for instance, I would not even know where to
start, about looking up the particular piece of code involved here. And
when I would find it, which may take me a couple of hours, I am not sure
that I would even understand that code.


You might be surprised at simple the code is.

http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java?view=annotate
(start at line 515)

http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java?view=annotate
(start at line 645)



Right, that's what I'm saying :

I didn't know the above, and maybe 1% of the people on this list would know 
that.
I would probably have started with
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/
then, among the 40-odd items mentioned there, I might have spotted the one named "session" 
(a clue, that), and clicked on it.


Then I would be at 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/
and have a choice of only 10 Java items, out of which I would not know for sure where I 
would find the right one.
Even if by selective luck I had clicked on the one named "ManagerBase.java", it would 
still have taken me quite a while to locate the interesting section at line 515.


But then, the code which I find there is still quite a puzzle for me, considering that you 
say below that the sessions are in a ConcurrentHashMap.

All I see there is an array, and a loop through that array.
I also don't understand what is actually done there, except apparently counting the 
invalid sessions in expireHere (but apparently only for the benefit of logging it when in 
debug mode).


So let's go to the other pointer you provide above (StandardSession, line 645).
There I see :

 public boolean isValid() {
646 
647 if (this.expiring) {
648 return true;
649 }
650 
651 if (!this.isValid) {
652 return false;
653 }
etc..

which, for my very basic knowledge of Java, is already quite confusing.
At line 651, is this a recursive call to the same method, or something else ?
..
But this is still not telling me what "session" really is; the code does some calculations 
based on the time and the expiration timeout, but this code does not actually seem to "do 
anything" to the session thing, whatever it may be.  It just returns a boolean value.

..
Ah, but I've aso seen a call to findSessions() somewhere, so let's look for 
that.
It is back in ManagerBase, line 703.

703 public Session[] findSessions() {
704 
705 return sessions.values().toArray(new Session[0]);
706 
707 }

Well at least I guess that this explains the sessions array above, kind of (except that I 
do not understand the "new Session[0]" argument).


I ain't seen a ConcurrentHashMap yet, nor any indication so far as to where the session 
information is really kept.  So far it /could/ be on disk, or just as well on a set of 
scrolls attached to pigeon legs. (*)


I am jesting a bit, but my point is still : for someone fluent in Java and Tomcat code, 
this may be a breeze.  But I am ready to bet that for 95% of the people coming to this 
list for information, it is everything but.
And after all, that's exactly why there are thousands of users of this list, and only a 
handful of Tomcat code committers.


And that's fine, and I am very happy to have some of these committers on this list, to 
explain in plain English how it really works, and rebutt the silly suggestions which I 
make out of ignorance.


But telling the average bloke here, that he should go and browse the code, before he makes 
a silly suggestion out of the goodness of his heart, may be a bit disingenuous, no ?

This is the Tomcat users' list, not the dev's one.


For background, the sessions are in a ConcurrentHashMap, keyed by
session ID.


So far thus, I am very happy to take your word for it, because I could not find this in 
the indicated code. (*)





...



If anyone is going to suggest changes to improve the current
implementation then, yes, I think they need to know what the current
implementation is before they make those suggestions. It simply isn't
possible to state that "B is likely to perform better than A" without an
understanding of what A is.



I stand chastised.
In my imagination, a "session" is something which could potentially contain a lot of data 
(what the application developer chooses to save in it, right ?), and could also need to be 
stored persistently across Tomcat restarts. Consequently (but wrongly) I assumed that at 
least the

Re: JMX access through firewall

2011-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thiago,

On 10/21/2011 1:37 PM, Thiago Moreira (timba) wrote:
> On my host machine I fired the tunneling with: ssh -v 
> -L10.226.2.212/8849/localhost/8849
> -L10.226.2.212/8850/localhost/8850 192.168.56.101

Is it possible that ssh is confused by your use of IPv6-style
forwarding syntax while using IPv4 addresses? Also, -L expects a space
between it and the forwarding specifier.

How about this:

ssh -L 10.226.2.212:8850:localhost:8850 \
-L 10.226.2.212:8850:localhost:8850

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

iEYEARECAAYFAk6h31QACgkQ9CaO5/Lv0PDNjQCeMLN901blBs4zDVUeZoCGQLVh
wlQAoJBV9nTl2fqRy5Bgv0YK57/Pa7m6
=bAqT
-END PGP SIGNATURE-

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



Re: [OT] control of session timed out with tomcat

2011-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tim,

On 10/21/2011 2:10 PM, Tim Watts wrote:
> On Fri, 2011-10-21 at 11:05 -0400, Christopher Schultz wrote: On
> 10/20/2011 7:01 PM, Tim Watts wrote:
 This was a while ago -- no HttpSessionListeners available --
 so we couldn't easily persist the session and recall it when
 the user logged in again.
> 
>> Wow. What were you using, Apache JServ? Tomcat 3.x?
> 
> It was 3.x I believe. Yes, I am that old. Eh, you kids today with
> your new fangled session listeners and what not. Back in the day we
> just let the user's work vanish into thin air ...and they were
> GRATEFUL! :-)

I was there for the 2.2->2.3 switch as well. I remember being handed a
"server runbook" that included Apache JServ, and configuring
everything was a tedious nightmare. I understand why some people post
to the list saying "my configuration doesn't work" and you find
they're using a TC 4.x server.xml file with TC 7.x: that's what the
runbook says, so they do it.

I distinctly remember personally upgrading our own "standard library"
code to move from the whole getValue/setValue to
getAttribute/setAttribute. My employer, for whatever reason, had also
implemented their own session management strategy and wired it into
their own "app framework" (I use that term *very* loosely). I
re-factored it to use standard HttpSessions under the hood and then
got to delete /lots/ of (IMO) completely useless code.

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

iEYEARECAAYFAk6h3YoACgkQ9CaO5/Lv0PDkuwCfeBlt55GCpcsGRBm10gX8rnWf
49UAnR96Q+Vdzpc4k5EpC5srpJuAJWCY
=HM2M
-END PGP SIGNATURE-

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



RE: Tomcat produces empty/missing log files

2011-10-21 Thread Daniel Mikusa
Brian,

If you can't put Log4j into WEB-INF/lib, could you try putting it into
"shared/lib"?  

I believe you mentioned that it was placed into "common/lib", which will
make it accessible to Tomcat & all of your webapps.  If you put it into
"shared/lib" it should only be accessible to your webapps, which should
hide it from Tomcat.

Dan



On Fri, 2011-10-21 at 12:53 -0700, Brian Jones wrote:
> Charles,
> 
> Thanks for your reply.
> 
> I'm not able to do as you suggested, because the software project is not
> managed by me, or my parent company. It is an open source enterprise system
> that is managed by a community and a foundation.
> 
> Also, it isn't just one project. The system I'm deploying is comprised of
> 100+ sub projects, that are all independent web apps which all interact
> together. Your suggestion would require me to go into 100+ projects to make
> those changes. Even if I wanted to make those changes, then I would be
> working on a separate branch of the source, and would thusly isolate my
> development from the community's.
> 
> Regards,
> 
> Brian J
> 
> 
> -Original Message-
> From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
> Sent: Friday, October 21, 2011 3:47 PM
> To: Tomcat Users List
> Subject: RE: Tomcat produces empty/missing log files
> 
> > From: Brian Jones [mailto:bjone...@uwo.ca] 
> > Subject: RE: Tomcat produces empty/missing log files
> 
> > Are there any known workarounds for using java.util.logging
> > instead of log4j even if the log4j.jar file is present?
> 
> If you only want log4j for a specific webapp rather than for Tomcat itself,
> put log4j.jar in WEB-INF/lib of the webapp, and the properties file in
> WEB-INF/classes.
> 
>  - 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
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


Re: Tomcat produces empty/missing log files

2011-10-21 Thread Konstantin Kolinko
2011/10/21 Brian Jones :
>
> That defiantly makes sense. Are there any known workarounds for using
> java.util.logging instead of log4j even if the log4j.jar file is present?
>

You will need to read Commons Logging documentation for that.

http://wiki.apache.org/commons/How_to_Configure_the_Logging_Factory_and_the_Logging_Class

http://commons.apache.org/logging/apidocs/org/apache/commons/logging/package-summary.html#package_description

Apparently you will need to set up the following system property
before starting Tomcat
(e.g. in a bin/setenv.bat file):

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger

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



RE: Tomcat produces empty/missing log files

2011-10-21 Thread Brian Jones
Yes, but the dependencies are not managed locally, it's done using a remote
maven repository.
Thus, it would affect the entire community. No?

Brian J.


-Original Message-
From: David kerber [mailto:dcker...@verizon.net] 
Sent: Friday, October 21, 2011 4:26 PM
To: Tomcat Users List
Subject: Re: Tomcat produces empty/missing log files

On 10/21/2011 3:53 PM, Brian Jones wrote:
> Charles,
>
> Thanks for your reply.
>
> I'm not able to do as you suggested, because the software project is not
> managed by me, or my parent company. It is an open source enterprise
system
> that is managed by a community and a foundation.
>
> Also, it isn't just one project. The system I'm deploying is comprised of
> 100+ sub projects, that are all independent web apps which all interact
> together. Your suggestion would require me to go into 100+ projects to
make
> those changes. Even if I wanted to make those changes, then I would be
> working on a separate branch of the source, and would thusly isolate my
> development from the community's.

I doubt that, because you're not modifying any source code, just moving 
libraries around.


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



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



Re: Tomcat produces empty/missing log files

2011-10-21 Thread David kerber

On 10/21/2011 3:53 PM, Brian Jones wrote:

Charles,

Thanks for your reply.

I'm not able to do as you suggested, because the software project is not
managed by me, or my parent company. It is an open source enterprise system
that is managed by a community and a foundation.

Also, it isn't just one project. The system I'm deploying is comprised of
100+ sub projects, that are all independent web apps which all interact
together. Your suggestion would require me to go into 100+ projects to make
those changes. Even if I wanted to make those changes, then I would be
working on a separate branch of the source, and would thusly isolate my
development from the community's.


I doubt that, because you're not modifying any source code, just moving 
libraries around.



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



RE: Tomcat produces empty/missing log files

2011-10-21 Thread Brian Jones
Charles,

Thanks for your reply.

I'm not able to do as you suggested, because the software project is not
managed by me, or my parent company. It is an open source enterprise system
that is managed by a community and a foundation.

Also, it isn't just one project. The system I'm deploying is comprised of
100+ sub projects, that are all independent web apps which all interact
together. Your suggestion would require me to go into 100+ projects to make
those changes. Even if I wanted to make those changes, then I would be
working on a separate branch of the source, and would thusly isolate my
development from the community's.

Regards,

Brian J


-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Friday, October 21, 2011 3:47 PM
To: Tomcat Users List
Subject: RE: Tomcat produces empty/missing log files

> From: Brian Jones [mailto:bjone...@uwo.ca] 
> Subject: RE: Tomcat produces empty/missing log files

> Are there any known workarounds for using java.util.logging
> instead of log4j even if the log4j.jar file is present?

If you only want log4j for a specific webapp rather than for Tomcat itself,
put log4j.jar in WEB-INF/lib of the webapp, and the properties file in
WEB-INF/classes.

 - 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



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



RE: Tomcat produces empty/missing log files

2011-10-21 Thread Caldarale, Charles R
> From: Brian Jones [mailto:bjone...@uwo.ca] 
> Subject: RE: Tomcat produces empty/missing log files

> Are there any known workarounds for using java.util.logging
> instead of log4j even if the log4j.jar file is present?

If you only want log4j for a specific webapp rather than for Tomcat itself, put 
log4j.jar in WEB-INF/lib of the webapp, and the properties file in 
WEB-INF/classes.

 - 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



Setting-up Tomcat in Eclipse

2011-10-21 Thread Christopher Lee
Version: Apache Tomcat-6.0-33
Operating System: Windows XP
Eclipse J2EE: Version: 3.5.2

I am using Eclipse Galileo to develop web applications. I attempted to 
integrate Apache Tomcat as an internal (local) server to develop, debug, test, 
and deploy my application code but I think I am having configuration problems. 
There may be several problems contributing to this. If anyone is aware of 
documentation that explains this process then that would be helpful. To set 
this up I used an IBM tutorial at the following link:

http://www.ibm.com/developerworks/opensource/library/os-eclipse-facebook/index.html

Thank you in advance for your time.

Best,

Christopher
This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information. If you have received it in 
error, please notify the sender immediately and delete the original. Any other 
use of the email by you is prohibited.


RE: Tomcat produces empty/missing log files

2011-10-21 Thread Brian Jones
Konstantine and Mark,

Thanks to both of you for your revelations; without you two I would truly be
lost.

That defiantly makes sense. Are there any known workarounds for using
java.util.logging instead of log4j even if the log4j.jar file is present?

Thanks again for allowing me to pick your brain.

Brian J


-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Friday, October 21, 2011 3:40 PM
To: Tomcat Users List
Subject: Re: Tomcat produces empty/missing log files

2011/10/21 Brian Jones :
> Yes, it appears that the project I'm deploying is relying on log4j for
> logging; so when I remove the log4j.jar file, it obviously complains that
it
> can't find it.
>
> However, what I don't understand is why Tomcat refuses to log to the log
> files if there is a log4j.jar file present in the common/lib folder.
> Shouldn't it be looking for the log4j.properties file to determine if it
> uses log4j or commons?

That "commons" is a wrapper that autoselects either java.util.logging or
log4j

See http://commons.apache.org/logging/

logging.properties is configuration file for java.util.logging.


Dropping in log4j*.jar is enough to confuse the wrapper so that
effectively logging.properties is not used at all.

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



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



Re: Tomcat produces empty/missing log files

2011-10-21 Thread Konstantin Kolinko
2011/10/21 Brian Jones :
> Yes, it appears that the project I'm deploying is relying on log4j for
> logging; so when I remove the log4j.jar file, it obviously complains that it
> can't find it.
>
> However, what I don't understand is why Tomcat refuses to log to the log
> files if there is a log4j.jar file present in the common/lib folder.
> Shouldn't it be looking for the log4j.properties file to determine if it
> uses log4j or commons?

That "commons" is a wrapper that autoselects either java.util.logging or log4j

See http://commons.apache.org/logging/

logging.properties is configuration file for java.util.logging.


Dropping in log4j*.jar is enough to confuse the wrapper so that
effectively logging.properties is not used at all.

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



RE: Tomcat produces empty/missing log files

2011-10-21 Thread Brian Jones
Yes, it appears that the project I'm deploying is relying on log4j for
logging; so when I remove the log4j.jar file, it obviously complains that it
can't find it.

However, what I don't understand is why Tomcat refuses to log to the log
files if there is a log4j.jar file present in the common/lib folder.
Shouldn't it be looking for the log4j.properties file to determine if it
uses log4j or commons? I verified that there is indeed no such
log4j.properties file, and the logging.properties file is in the correct
location.

The project I'm (attempting) to work on is a well known open source
enterprise LMS system. It is a very large system, comprised of 100+ sub
projects within the project itself. Building and dependencies are handled by
Maven. Not sure if that info helps with anything.

Thanks again,

Brian J.


-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Friday, October 21, 2011 3:31 PM
To: Tomcat Users List
Subject: Re: Tomcat produces empty/missing log files

On 21/10/2011 20:27, Brian Jones wrote:
> My mistake. The distro doesn't include the .jar by default. The project I
> deploy to Tomcat automatically sticks the log4j.jar file there.
> 
> Sorry for the confusion; I overlooked this step.

That begs the question "What else is it doing?" since it appears to be
breaking the Tomcat logging configuration.

Mark

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



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



Re: SSI SecurityException

2011-10-21 Thread Steve Major
Thanks, I figured that out shortly before getting your reply.

Moving the filter and mapping into the app's web.xml has eliminated the error 
from the logs, however, the ssi still won't display a result.

By this I mean if I insert: Today is  into my 
.jsp, when I view the page I only see "Today is".

My previous experience with Apache's SSI suggests if it wasn't enabled 
correctly, I'd see "Today is " on my page because 
it just would assume that directive is text.

Assuming Tomcat follows the same, it would tell me that it is parsing it and 
for whatever reason not outputting a result.  I could be wrong.

Thank you again for your time.
-Steve


On Oct 21, 2011, at 3:01 PM, Konstantin Kolinko wrote:

>> Should I copy it from the conf directory in its entirety or just a 
>> subsection of the file?
> 
> Only definition of the filter and its mapping.
> 
> Best regards,
> Konstantin Kolinko
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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



Re: Tomcat produces empty/missing log files

2011-10-21 Thread Mark Thomas
On 21/10/2011 20:27, Brian Jones wrote:
> My mistake. The distro doesn't include the .jar by default. The project I
> deploy to Tomcat automatically sticks the log4j.jar file there.
> 
> Sorry for the confusion; I overlooked this step.

That begs the question "What else is it doing?" since it appears to be
breaking the Tomcat logging configuration.

Mark

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



RE: Tomcat produces empty/missing log files

2011-10-21 Thread Brian Jones
My mistake. The distro doesn't include the .jar by default. The project I
deploy to Tomcat automatically sticks the log4j.jar file there.

Sorry for the confusion; I overlooked this step.

Brian J


-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Friday, October 21, 2011 3:23 PM
To: Tomcat Users List
Subject: Re: Tomcat produces empty/missing log files

On 21/10/2011 20:18, Brian Jones wrote:
> Thanks again for your insight into the problem.
> 
> Following your advice, I started from a fresh install of Tomcat 5.5.33.
> I noticed that log4j.1.2.16.jar is included in the common/lib folder by
> default.

No it isn't. Where are you getting this Tomcat distribution from?

Mark

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



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



Re: Tomcat produces empty/missing log files

2011-10-21 Thread Mark Thomas
On 21/10/2011 20:18, Brian Jones wrote:
> Thanks again for your insight into the problem.
> 
> Following your advice, I started from a fresh install of Tomcat 5.5.33.
> I noticed that log4j.1.2.16.jar is included in the common/lib folder by
> default.

No it isn't. Where are you getting this Tomcat distribution from?

Mark

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



RE: Tomcat produces empty/missing log files

2011-10-21 Thread Brian Jones
Thanks again for your insight into the problem.

Following your advice, I started from a fresh install of Tomcat 5.5.33.
I noticed that log4j.1.2.16.jar is included in the common/lib folder by
default.

The only modification I made was the small addition to logging.properties:

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level
= INFO

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
1catalina.org.apache.juli.FileHandler

I experienced the same results:
- on first run, everything is fine but logs are empty.
- second run I removed the log4j jar file
- Tomcat now produces the output in the log files, but now complains
several times about ClassDefNotFound for log4j

Cheers,

Brian J.


-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Friday, October 21, 2011 2:24 PM
To: Tomcat Users List
Subject: Re: Tomcat produces empty/missing log files

2011/10/21 Brian Jones :
>
>        It would be nice to see the actual command line that starts
Tomcat's
> Bootstrap. The JVM keys that configure  java.util.logging should be there.
>
> - I don't know what you mean by this.
>

I mean catalina.bat purpose is to prepare and call "java.exe". I'd
like to see the real command line that starts "java.exe".


> o   Followed instructions at
> http://tomcat.apache.org/tomcat-5.5-doc/logging.html to set up logging
>
>        Maybe 7.0 docs will be more understandable.
>
> - 7.0 docs are not applicable, as I'm dealing with v5.5.33, and cannot
> upgrade to newer versions of Tomcat because 5.5.33 is the only version
> supported by the software project I'm working on (as stated in previous
> message)

Have you tried reading them? I spent good time trying to improve those
docs, to better explain what is going on, but wouldn't backport those
to 5.5.x


>
> - Yes, restored to original configuration. If I remove the log4j-x.x.x.jar
> file, it will then throw multiple exceptions like
> "java.lang.NoClassDefFoundError: org/apache/log4j/Priority" while starting
> Tomcat

??? What throws it?
There should be a stacktrace.


Maybe you shall start with a fresh copy of 5.5.33?

>
> o  Contents of logging.properties file (located in BOTH /common/classes/
and
> /conf/ folders):
>
>        It should be only in conf.
>
> - The instructions at http://tomcat.apache.org/tomcat-5.5-doc/logging.html
> clearly state that the file is "to be placed in common/classes".

Huh. The doc is wrong there.

The file in common/classes will take priority over the one in conf,
but I'd say that that is an unusual configuration.

> Even so, I
> removed it from that directory, but get the same result
>
>        "Try to simplify your configuration.":
>
> - following your instructions I simplified the logging.properties file to
> the 1 entry you suggested. This produced some confusing results. The log
> file now contains MOST of the output; some exceptions found in the log;
the
> console was empty, but one exception was logged in the console and not in
> the log file.

Which one?

> Ideally (and what I think is normal behavior for Tomcat) it
> should be putting all output to the console, and duplicating all output to
> the log file.

In production you wouldn't want that output on console. It is harder
to rotate catalina.out.

>
> - I then did another experiment, keeping the more verbose
logging.properties
> file, and adding the following:
>
>        org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level
> = INFO
>
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
> 1catalina.org.apache.juli.FileHandler
>
> - With this change, I can see all output in the console, and I can see
that
> it's now putting some of the output in two different files,
> catalina.date.log and localhost.date.log

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

What is those "verbose logging.properties" and why those lines? You
are asking something, but are not providing facts. Do you expect
guesses as an answer?


Best regards,
Konstantin Kolinko

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



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



Re: SSI SecurityException

2011-10-21 Thread Konstantin Kolinko
2011/10/21 Steve Major :
> Hello, thank you for replying!
>
> Yes, that is the location I uncommented it since that is what their 
> instructions say. I'm only deploying a single webapp, so I do not mind it 
> being global.

So every webapp will load that filter and thus every webapp has to be
privileged

> Should I copy it from the conf directory in its entirety or just a subsection 
> of the file?

Only definition of the filter and its mapping.

Best regards,
Konstantin Kolinko

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



RE: Tomcat produces empty/missing log files

2011-10-21 Thread Brian Jones
Please find below the context of logging.properties (updated, the 'verbose'
copy, rather than the minimalized copy you had suggested previously):

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

handlers = 1catalina.org.apache.juli.FileHandler,
2localhost.org.apache.juli.FileHandler,
3manager.org.apache.juli.FileHandler, 4admin.org.apache.juli.FileHandler,
5host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

.handlers = 1catalina.org.apache.juli.FileHandler,
java.util.logging.ConsoleHandler


# Handler specific properties.
# Describes specific configuration info for Handlers.


1catalina.org.apache.juli.FileHandler.level = FINE
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.

2localhost.org.apache.juli.FileHandler.level = FINE
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.

3manager.org.apache.juli.FileHandler.level = FINE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.

4admin.org.apache.juli.FileHandler.level = FINE
4admin.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4admin.org.apache.juli.FileHandler.prefix = admin.

5host-manager.org.apache.juli.FileHandler.level = FINE
5host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
5host-manager.org.apache.juli.FileHandler.prefix = host-manager.

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter =
java.util.logging.SimpleFormatter



# Facility specific properties.
# Provides extra control for each logger.


org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
1catalina.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
2localhost.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].lev
el = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].han
dlers = 3manager.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].level
= INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].handl
ers = 4admin.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager
].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager
].handlers = 5host-manager.org.apache.juli.FileHandler

# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#org.apache.catalina.startup.ContextConfig.level = FINE
#org.apache.catalina.startup.HostConfig.level = FINE
#org.apache.catalina.session.ManagerBase.level = FINE


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



Re: SSI SecurityException

2011-10-21 Thread Steve Major
Hello, thank you for replying!

Yes, that is the location I uncommented it since that is what their 
instructions say. I'm only deploying a single webapp, so I do not mind it being 
global.  I do see how it would be tidier in the future, if I deploy more, to do 
it on a per-app basis.  If this is contributing to my current problem, I have 
no issues doing as you suggest.

Should I copy it from the conf directory in its entirety or just a subsection 
of the file?

Thank you again.
-Steve

On Oct 21, 2011, at 2:27 PM, Konstantin Kolinko wrote:

> 2011/10/21 Steve Major :
>> Hello folks,
>> 
>> I have a new Tomcat install, version 7.0.21 running on OS X 10.6.8 server 
>> (not using Apple's install of Tomcat, BTW), and Java 1.6.0.  I've 
>> successfully setup a SSI Filter before with Tomcat 6.0 a few years ago with 
>> the help of this list, but I'm just stuck right now.
>> 
>> I've uncommented the SSI Filters as described in: 
>> http://tomcat.apache.org/tomcat-7.0-doc/ssi-howto.html and enabled all files 
>> to be parsed with *
> 
> Where did you uncomment it?
> 
> You should not have modified conf/web.xml, because it applies to all
> webapps. You should copy it into your webapp only.
> 
> 
> Best regards,
> Konstantin Kolinko
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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



RE: Tomcat produces empty/missing log files

2011-10-21 Thread Brian Jones
The verbose file I was referring to was the original content of the
logging.properties file that I pasted in the previous message.

Brian J.


-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Friday, October 21, 2011 2:24 PM
To: Tomcat Users List
Subject: Re: Tomcat produces empty/missing log files

2011/10/21 Brian Jones :
>
>        It would be nice to see the actual command line that starts
Tomcat's
> Bootstrap. The JVM keys that configure  java.util.logging should be there.
>
> - I don't know what you mean by this.
>

I mean catalina.bat purpose is to prepare and call "java.exe". I'd
like to see the real command line that starts "java.exe".


> o   Followed instructions at
> http://tomcat.apache.org/tomcat-5.5-doc/logging.html to set up logging
>
>        Maybe 7.0 docs will be more understandable.
>
> - 7.0 docs are not applicable, as I'm dealing with v5.5.33, and cannot
> upgrade to newer versions of Tomcat because 5.5.33 is the only version
> supported by the software project I'm working on (as stated in previous
> message)

Have you tried reading them? I spent good time trying to improve those
docs, to better explain what is going on, but wouldn't backport those
to 5.5.x


>
> - Yes, restored to original configuration. If I remove the log4j-x.x.x.jar
> file, it will then throw multiple exceptions like
> "java.lang.NoClassDefFoundError: org/apache/log4j/Priority" while starting
> Tomcat

??? What throws it?
There should be a stacktrace.


Maybe you shall start with a fresh copy of 5.5.33?

>
> o  Contents of logging.properties file (located in BOTH /common/classes/
and
> /conf/ folders):
>
>        It should be only in conf.
>
> - The instructions at http://tomcat.apache.org/tomcat-5.5-doc/logging.html
> clearly state that the file is "to be placed in common/classes".

Huh. The doc is wrong there.

The file in common/classes will take priority over the one in conf,
but I'd say that that is an unusual configuration.

> Even so, I
> removed it from that directory, but get the same result
>
>        "Try to simplify your configuration.":
>
> - following your instructions I simplified the logging.properties file to
> the 1 entry you suggested. This produced some confusing results. The log
> file now contains MOST of the output; some exceptions found in the log;
the
> console was empty, but one exception was logged in the console and not in
> the log file.

Which one?

> Ideally (and what I think is normal behavior for Tomcat) it
> should be putting all output to the console, and duplicating all output to
> the log file.

In production you wouldn't want that output on console. It is harder
to rotate catalina.out.

>
> - I then did another experiment, keeping the more verbose
logging.properties
> file, and adding the following:
>
>        org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level
> = INFO
>
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
> 1catalina.org.apache.juli.FileHandler
>
> - With this change, I can see all output in the console, and I can see
that
> it's now putting some of the output in two different files,
> catalina.date.log and localhost.date.log

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

What is those "verbose logging.properties" and why those lines? You
are asking something, but are not providing facts. Do you expect
guesses as an answer?


Best regards,
Konstantin Kolinko

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



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



Re: SSI SecurityException

2011-10-21 Thread Konstantin Kolinko
2011/10/21 Steve Major :
> Hello folks,
>
> I have a new Tomcat install, version 7.0.21 running on OS X 10.6.8 server 
> (not using Apple's install of Tomcat, BTW), and Java 1.6.0.  I've 
> successfully setup a SSI Filter before with Tomcat 6.0 a few years ago with 
> the help of this list, but I'm just stuck right now.
>
> I've uncommented the SSI Filters as described in: 
> http://tomcat.apache.org/tomcat-7.0-doc/ssi-howto.html and enabled all files 
> to be parsed with *

Where did you uncomment it?

You should not have modified conf/web.xml, because it applies to all
webapps. You should copy it into your webapp only.


Best regards,
Konstantin Kolinko

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



Re: Tomcat produces empty/missing log files

2011-10-21 Thread Konstantin Kolinko
2011/10/21 Brian Jones :
>
>        It would be nice to see the actual command line that starts Tomcat's
> Bootstrap. The JVM keys that configure  java.util.logging should be there.
>
> - I don't know what you mean by this.
>

I mean catalina.bat purpose is to prepare and call "java.exe". I'd
like to see the real command line that starts "java.exe".


> o   Followed instructions at
> http://tomcat.apache.org/tomcat-5.5-doc/logging.html to set up logging
>
>        Maybe 7.0 docs will be more understandable.
>
> - 7.0 docs are not applicable, as I'm dealing with v5.5.33, and cannot
> upgrade to newer versions of Tomcat because 5.5.33 is the only version
> supported by the software project I'm working on (as stated in previous
> message)

Have you tried reading them? I spent good time trying to improve those
docs, to better explain what is going on, but wouldn't backport those
to 5.5.x


>
> - Yes, restored to original configuration. If I remove the log4j-x.x.x.jar
> file, it will then throw multiple exceptions like
> "java.lang.NoClassDefFoundError: org/apache/log4j/Priority" while starting
> Tomcat

??? What throws it?
There should be a stacktrace.


Maybe you shall start with a fresh copy of 5.5.33?

>
> o  Contents of logging.properties file (located in BOTH /common/classes/ and
> /conf/ folders):
>
>        It should be only in conf.
>
> - The instructions at http://tomcat.apache.org/tomcat-5.5-doc/logging.html
> clearly state that the file is "to be placed in common/classes".

Huh. The doc is wrong there.

The file in common/classes will take priority over the one in conf,
but I'd say that that is an unusual configuration.

> Even so, I
> removed it from that directory, but get the same result
>
>        "Try to simplify your configuration.":
>
> - following your instructions I simplified the logging.properties file to
> the 1 entry you suggested. This produced some confusing results. The log
> file now contains MOST of the output; some exceptions found in the log; the
> console was empty, but one exception was logged in the console and not in
> the log file.

Which one?

> Ideally (and what I think is normal behavior for Tomcat) it
> should be putting all output to the console, and duplicating all output to
> the log file.

In production you wouldn't want that output on console. It is harder
to rotate catalina.out.

>
> - I then did another experiment, keeping the more verbose logging.properties
> file, and adding the following:
>
>        org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level
> = INFO
>
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
> 1catalina.org.apache.juli.FileHandler
>
> - With this change, I can see all output in the console, and I can see that
> it's now putting some of the output in two different files,
> catalina.date.log and localhost.date.log

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

What is those "verbose logging.properties" and why those lines? You
are asking something, but are not providing facts. Do you expect
guesses as an answer?


Best regards,
Konstantin Kolinko

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



Re: [OT] control of session timed out with tomcat

2011-10-21 Thread Tim Watts
On Fri, 2011-10-21 at 11:05 -0400, Christopher Schultz wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Tim,
> 
> On 10/20/2011 7:01 PM, Tim Watts wrote:
> > This was a while ago -- no HttpSessionListeners available -- so we
> > couldn't easily persist the session and recall it when the user
> > logged in again.
> 
> Wow. What were you using, Apache JServ? Tomcat 3.x?

It was 3.x I believe. Yes, I am that old. Eh, you kids today with your
new fangled session listeners and what not. Back in the day we just let
the user's work vanish into thin air ...and they were GRATEFUL! :-)


> 
> I don't see from the API javadocs when HttpSessionBindingListener was
> introduced (it just says "$Version$" in 2.5 and nothing at all in
> 3.0), but that should have been around for a long time.
> 
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk6hikoACgkQ9CaO5/Lv0PAYtgCgtzkREusG5n1oGmTtC1pyMzKS
> iIYAnRUBhxc8q+qZ0E77m1UQRQIrPANX
> =P4Wf
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



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



RE: Tomcat application startup - Lifecycleexception

2011-10-21 Thread ramsri

Thanks for your guidance. Yes, I have native code and dd hence the .so file.
I cannot put that in Java. It is in C++.

I did put the LD_LIBRARY_PATH to point to the directory. The error I am
getting is

**
ERROR mycompany.site.newsp11  - The exception is of type
java.io.FileNotFoundException: The requested resource
(/mysite/servlet/SPServlet) is not available

***




n828cl wrote:
> 
>> From: ramsri [mailto:ramfi...@yahoo.com] 
>> Subject: Re: Tomcat application startup - Lifecycleexception
> 
>> I looked into my web.xml under $CATALINA_HOME/webapps/myapp/WEB-INF
>> and there I found a reference to a servlet-name 'Invoker'. I had read
>> about this somewhere.
> 
> In this day and age, using the Invoker servlet is a hanging offense:
> http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q3
> 
>> There is some other problem with my .so file.
> 
> What .so file?  Are you saying your webapp consists partly of native code? 
> What prevents you from coding that logic in Java?  If you actually do need
> native code, make sure the LD_LIBRARY_PATH environment variable or the
> Java system property java.library.path points to the location of the .so
> file so the JVM can find it when resolving references to functions in 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
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Tomcat-application-startup---Lifecycleexception-tp32693089p32698100.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: JMX access through firewall

2011-10-21 Thread Thiago Moreira (timba)
  Thanks Mark! I was able to connect visualvm to Tomcat without SSH
tunneling, that is a one step forward! But I'm still struggling with SSH
tunneling. Let me show what I have configured.

  I have a VirtualBox VM (Ubuntu-11.10) setup with a Tomcat (6.0.32) with
the following configurations:

  - setenv.sh
   JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=tmoreira2020-VirtualBox
-Dcom.sun.management.jmxremote.password
.file=$CATALINA_HOME/conf/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=$CATALINA_HOME/conf/jmxr
emote.access -Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxrem
ote.authenticate=false"

  - server.xml


  On my host machine I fired the tunneling with: *ssh -v
-L10.226.2.212/8849/localhost/8849 -L10.226.2.212/8850/localhost/8850
192.168.56.101* and started a Visualvm trying to connect using the following
url connection: *service:jmx:rmi://
10.226.2.212:8850/jndi/rmi://10.226.2.212:8849/jmxrmi* these configurations
seems to be the right ones but it does NOT work. I have tested several
others without success either. What I'm missing?

  Thanks

On Fri, Oct 21, 2011 at 11:17 AM, Mark Thomas  wrote:

> On 21/10/2011 13:56, Thiago Moreira (timba) wrote:
> > org.apache.catalina.mbeans.JmxRemoteLifecycleListener
>
> Read this http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html
>
> > org.apache.catalina.mbeans.JMXAdaptorLifecycleListener but none of them
> are
> > available in Tomcat (ClassNotFoundException).
>
> Quoting the above docs:
> This listener requires catalina-jmx-remote.jar to be placed in
> $CATALINA_HOME/lib. This jar may be found in the extras directory of the
> binary download area.
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


SSI SecurityException

2011-10-21 Thread Steve Major
Hello folks,

I have a new Tomcat install, version 7.0.21 running on OS X 10.6.8 server (not 
using Apple's install of Tomcat, BTW), and Java 1.6.0.  I've successfully setup 
a SSI Filter before with Tomcat 6.0 a few years ago with the help of this list, 
but I'm just stuck right now.

I've uncommented the SSI Filters as described in: 
http://tomcat.apache.org/tomcat-7.0-doc/ssi-howto.html and enabled all files to 
be parsed with *

I've made my app privileged with  based on the Manager app since it's already privileged.  
The META-INF directory in my app is where the context.xml is stored with this.

I'm using the Filters because I'd like it to find ssi directives within .jsp 
files.  When I launch Tomcat I see this in my logs:

SEVERE: Exception starting filter ssi
java.lang.SecurityException: Restricted class org.apache.catalina.ssi.SSIFilter
at 
org.apache.catalina.core.DefaultInstanceManager.checkAccess(DefaultInstanceManager.java:432)
at 
org.apache.catalina.core.DefaultInstanceManager.checkAccess(DefaultInstanceManager.java:421)
at 
org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:399)
at 
org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at 
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:252)
at 
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at 
org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:98)
at 
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4584)
at 
org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5262)
at 
org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5257)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)

As as test, I tried using the Servlet instead of the Filter and that worked - 
at least the ssi include was shown, although Tomcat then didn't process the 
.jsp which I would expect.

I'm sure this is the way I configured it on version 6, but I may have missed 
something when I made my notes on that install.

Any direction would be appreciated.
-Steve


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



RE: Tomcat produces empty/missing log files

2011-10-21 Thread Brian Jones
o   Tried running the .bat file from the command line directly piping output
to a local .txt file; all that gets piped to the .txt file is the java
environment variables that are being used

startup.bat is equivalent to calling "catalina.bat start"

Try using "catalina.bat run" instead.

- This command works, but then output is not seen on the console. I'm trying
to achieve normal funcationality, where the console displays all output, but
is DUPLICATED in the log file (which should normally be stdout.log or
catalina.out)

o   Modified catalina.bat to pipe %EXECJAVA% . %ACTION% commands to log file
(didn't work, nothing in the log file)

It would be nice to see the actual command line that starts Tomcat's
Bootstrap. The JVM keys that configure  java.util.logging should be there.

- I don't know what you mean by this.

o   Followed instructions at
http://tomcat.apache.org/tomcat-5.5-doc/logging.html to set up logging

Maybe 7.0 docs will be more understandable.

- 7.0 docs are not applicable, as I'm dealing with v5.5.33, and cannot
upgrade to newer versions of Tomcat because 5.5.33 is the only version
supported by the software project I'm working on (as stated in previous
message)

o  Tried log4j; log files didn't contain exception messages

Did you restore original configuration after these experiments? Did
you remove log4j.jar?

- Yes, restored to original configuration. If I remove the log4j-x.x.x.jar
file, it will then throw multiple exceptions like
"java.lang.NoClassDefFoundError: org/apache/log4j/Priority" while starting
Tomcat

o  Contents of logging.properties file (located in BOTH /common/classes/ and
/conf/ folders):

It should be only in conf.

- The instructions at http://tomcat.apache.org/tomcat-5.5-doc/logging.html
clearly state that the file is "to be placed in common/classes". Even so, I
removed it from that directory, but get the same result

"Try to simplify your configuration.":

- following your instructions I simplified the logging.properties file to
the 1 entry you suggested. This produced some confusing results. The log
file now contains MOST of the output; some exceptions found in the log; the
console was empty, but one exception was logged in the console and not in
the log file. Ideally (and what I think is normal behavior for Tomcat) it
should be putting all output to the console, and duplicating all output to
the log file.

- I then did another experiment, keeping the more verbose logging.properties
file, and adding the following:

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level
= INFO

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
1catalina.org.apache.juli.FileHandler

- With this change, I can see all output in the console, and I can see that
it's now putting some of the output in two different files,
catalina.date.log and localhost.date.log
- At this point, I'm just confused as to what and why certain output is
being put in one file versus the other
- And it's still throwing exceptions about not being able to find log4j
- Using the above addition to the more verbose logging.properties file and
KEEPING the log4j.jar file in the common/lib folder produces some more
confusion
- All output is shown in the console, there are no log4j exceptions
thrown, but the log files are empty again.

Any more ideas? It seems like the modification to the logging.properties
file was very close to achieving the goal, if only it didn't keep throwing
exceptions about log4j.

Thanks again,

Brian J.


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



Re: FarmWarDeployer undeploy on slave node when tomcat restart

2011-10-21 Thread Mark Eggers
- Original Message -

> From: Marco Betti 
> To: Tomcat Users List 
> Cc: 
> Sent: Friday, October 21, 2011 7:18 AM
> Subject: Re: FarmWarDeployer undeploy on slave node when tomcat restart
> 
> Hi Keiichi,
> many thanks for your suggestion.
> By setting synchronous replication everything works.
> Unless processing updated war by one message, I think that async replication
> shouldn't be used (personal opinion).
> By the way I wander If asnyc replication couldn't lead to some other
> unexpected behavior.
> 
> Many thanks,
> Marco
> 
> 
> 
> 
> On Fri, Oct 21, 2011 at 12:10 PM, Keiichi Fujino  
> wrote:
> 
>>  I checked FarmWarDeployer's code.
>>  When WAR is updated, FarmWarDeployer sends UndeployMessage and sends
>>  FileMessage after that.
>>  The node which received UndeployMessage undeploys war.
>>  The node which received FileMessage deploys war.
>> 
>>  If FileMessage is received while processing UndeployMessage, the
>>  following error messages will be outputted.
>>  "SEVERE: Application /example in used. touch war file example.war 
> again!"
>> 
>>  In the case of asynchronous replication (default), FileMessage may be
>>  received while processing UndeployMessage.
>> 
>>  I think that it may be better to process updated war by one message.
>>  Although I consider correction of a code, there is one work around.
>> 
>>  Workaround is change in synchronous mode.
>> 
>>  Please try the following.
>>   className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
>>  channelSendOptions="6">
>> 
>> 
>>  2011/10/21 Marco Betti :
>>  > Tried also on Tomcat 7.0.22
>>  >
>>  > Same behaviour: when i restart node1, FarmWarDeployer undeploy my war
>>  both
>>  > from node1 and node2, but re-deploy it only on node1.
>>  > If I touch my war in my watchDir on node1, tomcat redeploys it 
> correctly
>>  on
>>  > both nodes...
>>  >
>>  > Is tomcat clustering used?
>>  >
>>  > If so, does anybody use FarmWarDeployer  ?
>>  >
>>  > Many thanks,
>>  > Marco
>>  >
>>  >
>>  >
>>  > On Thu, Oct 20, 2011 at 6:21 PM, Marco Betti  
> wrote:
>>  >
>>  >> Hi all,
>>  >> I'm new to the list.
>>  >> I'm trying to configure tomcat 6.0.33 clustering.
>>  >> Session replication is ok.
>>  >> I've a problem with FarmWarDeployer.
>>  >> I found that:
>>  >>
>>  >> 1. You have to place the  node under the 
>  element.
>>  >>
>>  >> Tomcat 6.0.x complains that the element Cluster/Deployer element 
> is not
>>  >> understood at the Engine level.
>>  >>
>>  >> 2. One node needs to have watchEnabled="true", all other 
> nodes
>>  >> watchEnabled="false"
>>  >>
>>  >> 3. deployDir is the same as appBase
>>  >>
>>  >>
>>  >> and after I found this post that confirmed these points to me:
>>  >>
>>  >> http://www.mail-archive.com/users@tomcat.apache.org/msg80374.html
>>  >>
>>  >> The problem is the following:
>>  >> let node1 be the master (watchEnabled="true") and node2 
> the slave
>>  >> (watchEnabled="false")
>>  >> This is my configuration:
>>  >>  className="org.apache.catalina.ha.deploy.FarmWarDeployer"
>>  >>
>>  >>
>> 
> tempDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/temp/"
>>  >>
>>  >>
>> 
> deployDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/webapps/"
>>  >>
>>  >>
>> 
> watchDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/farm/"
>>  >>                     watchEnabled="true"/>
>>  >>
>>  >>
>>  >> If I copy a war to watchDir of node1 evertything works fine and 
> cluster
>>  >> deploy is achieved.
>>  >>
>>  >> When i restart node1, FarmWarDeployer undeploy my war both from 
> node1
>>  and
>>  >> node2, but re-deploy it only on node1.
>>  >>
>>  >> node1 log:
>>  >>
>>  >> INFO: Cluster wide remove of web app /example
>>  >> Oct 20, 2011 5:50:46 PM org.apache.catalina.startup.HostConfig
>>  >> checkResources
>>  >> INFO: Undeploying context [/example]
>>  >> Oct 20, 2011 5:50:46 PM org.apache.catalina.startup.HostConfig 
> deployWAR
>>  >> INFO: Deploying web application archive example.war
>>  >>
>>  >>
>>  >> node2 log:
>>  >>
>>  >> INFO: Undeploying context [/example]
>>  >> Oct 20, 2011 5:50:47 PM 
> org.apache.catalina.ha.deploy.FarmWarDeployer
>>  >> messageReceived
>>  >> SEVERE: Application /example in used. touch war file example.war 
> again!
>>  >>
>>  >>
>>  >> Obviously, if I touch my war in my watchDir on node1, tomcat 
> redeploys
>>  it
>>  >> correctly on both nodes... but this cannot be the solution...
>>  >>
>>  >>
>>  >> Is it a known problem?
>>  >>
>>  >> Could anyone help me?
>>  >>
>>  >> Many thanks,
>>  >> Marco
>>  >>



I've noticed this as well with FarmWarDeployer. However, I've always used 
synchronous as the channel option so it's not been a problem.

As to the placement of the cluster, yes you have to place it at the Host 
element in order for FarmWarDeployer to work. That note is buried in the 
documentation somewhere.

Another thing on my to-do list is to write up a basic clustering HOW-TO. 
Unfortunately right n

Re: JAR locked in Tomcat after using addUrl to dynamically add JAR to running webapp

2011-10-21 Thread Mark Thomas
On 21/10/2011 15:31, Mark Thomas wrote:
> On 21/10/2011 13:12, Bob DeRemer wrote:
>> Thanks Mark, I appreciate the offer.  Let me dig into a bit today -
>> based on your steps.   if I can't get anywhere, I'll gladly take you
>> up on your offer.  What is the best way to communicate out-of-band if
>> I need to get you a snapshot?
> 
> Bob and I took at look at this off-list using the standard approach for
> finding web-app reload memory leaks [1] and found what appears to be an
> issue with Tomcat's memory leak protection for the http keep-alive thread.
> 
> Tomcat only clears the WebappClassLoader from the http keep-alive thread
> if the thread is still running. It should clear it in all circumstances.
> 
> Ill be updating Tomcat to address this shortly.

I have updated 7.0.x trunk. If you want to try it out, you'll need to
build Tomcat from source. Instructions to do this are here:

http://tomcat.apache.org/tomcat-7.0-doc/building.html

The short version is:
svn co http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/ tomcat-7
cd tomcat-7
ant

Mark

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



Re: [OT] control of session timed out with tomcat

2011-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tim,

On 10/20/2011 7:01 PM, Tim Watts wrote:
> This was a while ago -- no HttpSessionListeners available -- so we
> couldn't easily persist the session and recall it when the user
> logged in again.

Wow. What were you using, Apache JServ? Tomcat 3.x?

I don't see from the API javadocs when HttpSessionBindingListener was
introduced (it just says "$Version$" in 2.5 and nothing at all in
3.0), but that should have been around for a long time.

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

iEYEARECAAYFAk6hikoACgkQ9CaO5/Lv0PAYtgCgtzkREusG5n1oGmTtC1pyMzKS
iIYAnRUBhxc8q+qZ0E77m1UQRQIrPANX
=P4Wf
-END PGP SIGNATURE-

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



Re: JAR locked in Tomcat after using addUrl to dynamically add JAR to running webapp

2011-10-21 Thread Mark Thomas
On 21/10/2011 13:12, Bob DeRemer wrote:
> Thanks Mark, I appreciate the offer.  Let me dig into a bit today -
> based on your steps.   if I can't get anywhere, I'll gladly take you
> up on your offer.  What is the best way to communicate out-of-band if
> I need to get you a snapshot?

Bob and I took at look at this off-list using the standard approach for
finding web-app reload memory leaks [1] and found what appears to be an
issue with Tomcat's memory leak protection for the http keep-alive thread.

Tomcat only clears the WebappClassLoader from the http keep-alive thread
if the thread is still running. It should clear it in all circumstances.

Ill be updating Tomcat to address this shortly.

Mark

[1]
http://people.apache.org/~markt/presentations/2010-11-04-Memory-Leaks-60mins.pdf

> 
> -bob
> 
> -Original Message- From: Mark Thomas
> [mailto:ma...@apache.org] Sent: Friday, October 21, 2011 7:42 AM To:
> Tomcat Users List Subject: Re: JAR locked in Tomcat after using
> addUrl to dynamically add JAR to running webapp
> 
> On 21/10/2011 12:22, Bob DeRemer wrote:
>> Hi Mark,
>> 
>> With regard to using Tomcat in production, that was meant 
>> sarcastically - the team has done a nice job on later Tomcat 6 and
>>  Tomcat 7 32/64-bit installations - including Windows Service
>> support, etc. - nice work.
> 
> That comment was more aimed at the archives than you ;)
> 
>> With regard to using YourKit, I have a licensed copy, but must be 
>> missing something - where can I look to see what is holding a 
>> reference to the JAR?  I've used it for memory analysis and CPU 
>> profiling - primarily, but I'm not sure where to look for JAR 
>> references.
> 
> File locks can be tricky to pin down. I usually do something along
> the lines of: 1. Take a memory snapshot 2. Switch to the object view 
> 3. Search for the name of the JAR 4. Trace the GC roots of a
> promising looking object
> 
> Normally, the JAR name appears in a String for a JarFile or File
> object and that traces back to whatever is holding the reference.
> 
> I'd be happy to take a look at the snapshot for you if you can put
> the snapshot somewhere where I can download it.
> 
> Mark
> 
> 
>> 
>> Thanks, Bob
>> 
>> -Original Message- From: Mark Thomas
>> [mailto:ma...@apache.org] Sent: Friday, October 21, 2011 2:46 AM
>> To: Tomcat Users List Subject: Re: JAR locked in Tomcat after using
>> addUrl to dynamically add JAR to running webapp
>> 
>> On 21/10/2011 03:00, Bob DeRemer wrote:
>>> While I can appreciate the desire to never use Windows, that
>>> isn't reality in many of the industries that use our product, so
>>> running Tomcat on windows can't be considered an oddity or edge
>>> case.  If it is, we better look for another app server.
>> 
>> If that were the case, the Tomcat devs wouldn't have put the 
>> investment they have into the Windows installer in recent months
>> (auto detection of 32 or 64 bit JRE, greater control over ports,
>> multiple service installs of the same version, ...)
>> 
>>> With regard to finding a solution, I'll try the antiJarLocking 
>>> setting, but I don't have any problem with any other JARS, so I
>>> don't hold out much hope for this fixing my problem.  I may look
>>> at upgrading to JDK 7 - which has added a "close" method to the 
>>> URLClassLoader.  Perhaps this might fix it.
>> 
>> Maybe.
>> 
>>> If anyone else has any other ideas why ONLY JARs added via the
>>> addURL "hack" I've shown below don't get unloaded when the WEBAPP
>>> is shutdown - vs stopping Tomcat completely, I would greatly
>>> appreciate it.
>> 
>> You need to understand the root cause. I'd recommend getting a 
>> profiler (I use YourKit since they give free copies to Tomcat 
>> committers) and finding out exactly what is holding references to 
>> those JARs. Once you know that the next questions are 1. What
>> creates those references and 2. How to get rid of them.
>> 
>> Mark
>> 
>> -
>>
>>
>
>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
>> 
>> -
>>
>>
>
>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
> 
> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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



Re: FarmWarDeployer undeploy on slave node when tomcat restart

2011-10-21 Thread Marco Betti
Hi Keiichi,
many thanks for your suggestion.
By setting synchronous replication everything works.
Unless processing updated war by one message, I think that async replication
shouldn't be used (personal opinion).
By the way I wander If asnyc replication couldn't lead to some other
unexpected behavior.

Many thanks,
Marco




On Fri, Oct 21, 2011 at 12:10 PM, Keiichi Fujino  wrote:

> I checked FarmWarDeployer's code.
> When WAR is updated, FarmWarDeployer sends UndeployMessage and sends
> FileMessage after that.
> The node which received UndeployMessage undeploys war.
> The node which received FileMessage deploys war.
>
> If FileMessage is received while processing UndeployMessage, the
> following error messages will be outputted.
> "SEVERE: Application /example in used. touch war file example.war again!"
>
> In the case of asynchronous replication (default), FileMessage may be
> received while processing UndeployMessage.
>
> I think that it may be better to process updated war by one message.
> Although I consider correction of a code, there is one work around.
>
> Workaround is change in synchronous mode.
>
> Please try the following.
>  channelSendOptions="6">
>
>
> 2011/10/21 Marco Betti :
> > Tried also on Tomcat 7.0.22
> >
> > Same behaviour: when i restart node1, FarmWarDeployer undeploy my war
> both
> > from node1 and node2, but re-deploy it only on node1.
> > If I touch my war in my watchDir on node1, tomcat redeploys it correctly
> on
> > both nodes...
> >
> > Is tomcat clustering used?
> >
> > If so, does anybody use FarmWarDeployer  ?
> >
> > Many thanks,
> > Marco
> >
> >
> >
> > On Thu, Oct 20, 2011 at 6:21 PM, Marco Betti  wrote:
> >
> >> Hi all,
> >> I'm new to the list.
> >> I'm trying to configure tomcat 6.0.33 clustering.
> >> Session replication is ok.
> >> I've a problem with FarmWarDeployer.
> >> I found that:
> >>
> >> 1. You have to place the  node under the  element.
> >>
> >> Tomcat 6.0.x complains that the element Cluster/Deployer element is not
> >> understood at the Engine level.
> >>
> >> 2. One node needs to have watchEnabled="true", all other nodes
> >> watchEnabled="false"
> >>
> >> 3. deployDir is the same as appBase
> >>
> >>
> >> and after I found this post that confirmed these points to me:
> >>
> >> http://www.mail-archive.com/users@tomcat.apache.org/msg80374.html
> >>
> >> The problem is the following:
> >> let node1 be the master (watchEnabled="true") and node2 the slave
> >> (watchEnabled="false")
> >> This is my configuration:
> >>  >>
> >>
> tempDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/temp/"
> >>
> >>
> deployDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/webapps/"
> >>
> >>
> watchDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/farm/"
> >> watchEnabled="true"/>
> >>
> >>
> >> If I copy a war to watchDir of node1 evertything works fine and cluster
> >> deploy is achieved.
> >>
> >> When i restart node1, FarmWarDeployer undeploy my war both from node1
> and
> >> node2, but re-deploy it only on node1.
> >>
> >> node1 log:
> >>
> >> INFO: Cluster wide remove of web app /example
> >> Oct 20, 2011 5:50:46 PM org.apache.catalina.startup.HostConfig
> >> checkResources
> >> INFO: Undeploying context [/example]
> >> Oct 20, 2011 5:50:46 PM org.apache.catalina.startup.HostConfig deployWAR
> >> INFO: Deploying web application archive example.war
> >>
> >>
> >> node2 log:
> >>
> >> INFO: Undeploying context [/example]
> >> Oct 20, 2011 5:50:47 PM org.apache.catalina.ha.deploy.FarmWarDeployer
> >> messageReceived
> >> SEVERE: Application /example in used. touch war file example.war again!
> >>
> >>
> >> Obviously, if I touch my war in my watchDir on node1, tomcat redeploys
> it
> >> correctly on both nodes... but this cannot be the solution...
> >>
> >>
> >> Is it a known problem?
> >>
> >> Could anyone help me?
> >>
> >> Many thanks,
> >> Marco
> >>
> >
>
>
>
> --
> Keiichi.Fujino
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Ing. Marco Betti
RHCE RHEL4 id 804006512121056


RE: docBase="" and in server.xml

2011-10-21 Thread Caldarale, Charles R
> From: Gianoglio Gabriele [mailto:g.gianog...@eurogroup.it] 
> Subject: docBase="" and  in server.xml

> in my Tomcat 5.5 instance I'm trying to set a webapp as the 
> root (docBase="") webapp

Right there you have a fatal error; docBase must *never* be an empty string.

Please read the FAQ entry for making a webapp the default one:

http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F

The simple way is to not put the  in server.xml (almost always a bad 
idea), and name your webapp ROOT (case sensitive).

 - 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: JMX access through firewall

2011-10-21 Thread Mark Thomas
On 21/10/2011 13:56, Thiago Moreira (timba) wrote:
> org.apache.catalina.mbeans.JmxRemoteLifecycleListener

Read this http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html

> org.apache.catalina.mbeans.JMXAdaptorLifecycleListener but none of them are
> available in Tomcat (ClassNotFoundException).

Quoting the above docs:
This listener requires catalina-jmx-remote.jar to be placed in
$CATALINA_HOME/lib. This jar may be found in the extras directory of the
binary download area.

Mark

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



Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread Mark Thomas
On 21/10/2011 13:43, André Warnier wrote:
> Mark Thomas wrote:
> 
>> On 21/10/2011 11:42, André Warnier wrote:
>>> Allright, so how about a half-way house to start with ?
>>> Keep the list in some thread-safe table, indexed by session-id, and just
>>> scan the table.
>>> Updating the corresponding session entry at each request should be
>>> cheap.
>>>
>>> Of course in all this, my basic assumption is that currently, Tomcat
>>> keeps session information (including the expiration data) in some
>>> location which requires an I/O action to access.
>>
>> That assumption is incorrect. Which pretty much invalidates the rest of
>> the points below.
>>
>> Again, I *strongly* encourage you to look at the current implementation
>> before suggesting improvements.
>>
> 
> Mark,
> 
> with all due respect and really sincere appreciation for your and other
> Tomcat committers' work,
> 
> not all people who use Tomcat, and who sometimes try to be helpful in
> this forum, are Java developers, or even software developers in general.
> And such people also have other things which occupy their time for $
> reasons.
> 
> What I'm saying, is that what for you or other Tomcat committers may be
> a simple thing of 2 minutes to look up and understand, or which you do
> not even need to look up because you already know it for being immersed
> in it all day, is not necessarily so simple for others.
> 
> In a case like this one for instance, I would not even know where to
> start, about looking up the particular piece of code involved here. And
> when I would find it, which may take me a couple of hours, I am not sure
> that I would even understand that code.

You might be surprised at simple the code is.

http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java?view=annotate
(start at line 515)

http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java?view=annotate
(start at line 645)

For background, the sessions are in a ConcurrentHashMap, keyed by
session ID.

> This is not out of laziness.  It just so happens that 98% of my time is
> spent on other things than Java and Tomcat, and the remaining 2% I like
> to keep for reading the spirited correspondence on this list and trying
> to help on matters where a deep knowledge of Java and Tomcat code is not
> essential.
> 
> I apologise thus if you feel that I am wasting your time by making
> unwarranted suppositions or assumptions.  Even when making improper
> assumptions and suggestions, it is on the base of a desire to help.  I
> can of course stop this at any time, if you feel that my attempted
> contributions do more harm than good.

If anyone is going to suggest changes to improve the current
implementation then, yes, I think they need to know what the current
implementation is before they make those suggestions. It simply isn't
possible to state that "B is likely to perform better than A" without an
understanding of what A is.

In this case, you pretty much ended up describing exactly how Tomcat
currently manages sessions. Was this a waste of my time? If a few more
people now have a better understanding of how session management works
then no, I don't think it was a waste of my time.

Mark

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



JMX access through firewall

2011-10-21 Thread Thiago Moreira (timba)
  Hi there,

  I'm trying to attach a Visualvm to a Tomcat (6.0.32) in a remote computer
that only has the port 22 opened. I'm opening a ssh tunnel to bypass the
firewall and access different ports but JMX over RMI it's not working. I
have tried several tutorials but I didn't manage to work.

  http://blogs.oracle.com/jmxetc/entry/connecting_through_firewall_using_jmx
  http://www.junlu.com/msg/394744.html

  I also see that there are some listeners that can help to get this working
like org.apache.catalina.mbeans.JmxRemoteLifecycleListener and
org.apache.catalina.mbeans.JMXAdaptorLifecycleListener but none of them are
available in Tomcat (ClassNotFoundException).

  After a day trying to find a solution I found this article that seems to
be easier but I wasn't able to configure Tomcat to use JMX over JMXMP. How
can I do that?

  http://blog.markfeeney.com/2010/10/jmx-through-ssh-tunnel.html

  Thanks in advance!

  Thiago Moreira


Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread André Warnier

Mark Thomas wrote:


On 21/10/2011 11:42, André Warnier wrote:

Allright, so how about a half-way house to start with ?
Keep the list in some thread-safe table, indexed by session-id, and just
scan the table.
Updating the corresponding session entry at each request should be cheap.

Of course in all this, my basic assumption is that currently, Tomcat
keeps session information (including the expiration data) in some
location which requires an I/O action to access.


That assumption is incorrect. Which pretty much invalidates the rest of
the points below.

Again, I *strongly* encourage you to look at the current implementation
before suggesting improvements.



Mark,

with all due respect and really sincere appreciation for your and other Tomcat committers' 
work,


not all people who use Tomcat, and who sometimes try to be helpful in this forum, are Java 
developers, or even software developers in general.

And such people also have other things which occupy their time for $ reasons.

What I'm saying, is that what for you or other Tomcat committers may be a simple thing of 
2 minutes to look up and understand, or which you do not even need to look up because you 
already know it for being immersed in it all day, is not necessarily so simple for others.


In a case like this one for instance, I would not even know where to start, about looking 
up the particular piece of code involved here. And when I would find it, which may take me 
a couple of hours, I am not sure that I would even understand that code.


This is not out of laziness.  It just so happens that 98% of my time is spent on other 
things than Java and Tomcat, and the remaining 2% I like to keep for reading the spirited 
correspondence on this list and trying to help on matters where a deep knowledge of Java 
and Tomcat code is not essential.


I apologise thus if you feel that I am wasting your time by making unwarranted 
suppositions or assumptions.  Even when making improper assumptions and suggestions, it is 
on the base of a desire to help.  I can of course stop this at any time, if you feel that 
my attempted contributions do more harm than good.



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



Regarding thread pool utilization monitoring using ThreadPool MBeans

2011-10-21 Thread akshay hiremath
Hi,

I'm using Tomcat 7.0.20.

I'm writing java code for automated Thread utilization monitoring and alert 
system.


I'm struggling to find the Mbean descriptor for Mbeans under 
Catalina.ThreadPool.

Can anyone provide any reference?

The big question I've is what the currentThreadCount indicates if these are no. 
of active threads then what is currentThreadsBusy, also minSpareThreads, 
maxSpareThreads, acceptorThreadCount.

I tried to find the descriptors in Tomcat Source Code but didn't get any.

Any help on this is really appreciated.



Regards,
Akshay


RE: JAR locked in Tomcat after using addUrl to dynamically add JAR to running webapp

2011-10-21 Thread Bob DeRemer
Thanks Mark, I appreciate the offer.  Let me dig into a bit today - based on 
your steps.   if I can't get anywhere, I'll gladly take you up on your offer.  
What is the best way to communicate out-of-band if I need to get you a snapshot?

-bob

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Friday, October 21, 2011 7:42 AM
To: Tomcat Users List
Subject: Re: JAR locked in Tomcat after using addUrl to dynamically add JAR to 
running webapp

On 21/10/2011 12:22, Bob DeRemer wrote:
> Hi Mark,
> 
> With regard to using Tomcat in production, that was meant 
> sarcastically - the team has done a nice job on later Tomcat 6 and 
> Tomcat 7 32/64-bit installations - including Windows Service support, 
> etc. - nice work.

That comment was more aimed at the archives than you ;)

> With regard to using YourKit, I have a licensed copy, but must be 
> missing something - where can I look to see what is holding a 
> reference to the JAR?  I've used it for memory analysis and CPU 
> profiling - primarily, but I'm not sure where to look for JAR 
> references.

File locks can be tricky to pin down. I usually do something along the lines of:
1. Take a memory snapshot
2. Switch to the object view
3. Search for the name of the JAR
4. Trace the GC roots of a promising looking object

Normally, the JAR name appears in a String for a JarFile or File object and 
that traces back to whatever is holding the reference.

I'd be happy to take a look at the snapshot for you if you can put the snapshot 
somewhere where I can download it.

Mark


> 
> Thanks, Bob
> 
> -Original Message- From: Mark Thomas [mailto:ma...@apache.org] 
> Sent: Friday, October 21, 2011 2:46 AM To:
> Tomcat Users List Subject: Re: JAR locked in Tomcat after using addUrl 
> to dynamically add JAR to running webapp
> 
> On 21/10/2011 03:00, Bob DeRemer wrote:
>> While I can appreciate the desire to never use Windows, that isn't  
>> reality in many of the industries that use our product, so running  
>> Tomcat on windows can't be considered an oddity or edge case.  If it 
>> is, we better look for another app server.
> 
> If that were the case, the Tomcat devs wouldn't have put the 
> investment they have into the Windows installer in recent months (auto 
> detection of 32 or 64 bit JRE, greater control over ports, multiple 
> service installs of the same version, ...)
> 
>> With regard to finding a solution, I'll try the antiJarLocking 
>> setting, but I don't have any problem with any other JARS, so I don't 
>> hold out much hope for this fixing my problem.  I may look at  
>> upgrading to JDK 7 - which has added a "close" method to the 
>> URLClassLoader.  Perhaps this might fix it.
> 
> Maybe.
> 
>> If anyone else has any other ideas why ONLY JARs added via the addURL 
>> "hack" I've shown below don't get unloaded when the WEBAPP is 
>> shutdown - vs stopping Tomcat completely, I would greatly appreciate 
>> it.
> 
> You need to understand the root cause. I'd recommend getting a 
> profiler (I use YourKit since they give free copies to Tomcat
> committers) and finding out exactly what is holding references to 
> those JARs. Once you know that the next questions are 1. What creates 
> those references and 2. How to get rid of them.
> 
> Mark
> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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


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



Re: JAR locked in Tomcat after using addUrl to dynamically add JAR to running webapp

2011-10-21 Thread Mark Thomas
On 21/10/2011 12:22, Bob DeRemer wrote:
> Hi Mark,
> 
> With regard to using Tomcat in production, that was meant
> sarcastically - the team has done a nice job on later Tomcat 6 and
> Tomcat 7 32/64-bit installations - including Windows Service support,
> etc. - nice work.

That comment was more aimed at the archives than you ;)

> With regard to using YourKit, I have a licensed copy, but must be
> missing something - where can I look to see what is holding a
> reference to the JAR?  I've used it for memory analysis and CPU
> profiling - primarily, but I'm not sure where to look for JAR
> references.

File locks can be tricky to pin down. I usually do something along the
lines of:
1. Take a memory snapshot
2. Switch to the object view
3. Search for the name of the JAR
4. Trace the GC roots of a promising looking object

Normally, the JAR name appears in a String for a JarFile or File object
and that traces back to whatever is holding the reference.

I'd be happy to take a look at the snapshot for you if you can put the
snapshot somewhere where I can download it.

Mark


> 
> Thanks, Bob
> 
> -Original Message- From: Mark Thomas
> [mailto:ma...@apache.org] Sent: Friday, October 21, 2011 2:46 AM To:
> Tomcat Users List Subject: Re: JAR locked in Tomcat after using
> addUrl to dynamically add JAR to running webapp
> 
> On 21/10/2011 03:00, Bob DeRemer wrote:
>> While I can appreciate the desire to never use Windows, that isn't
>>  reality in many of the industries that use our product, so running
>>  Tomcat on windows can't be considered an oddity or edge case.  If
>> it is, we better look for another app server.
> 
> If that were the case, the Tomcat devs wouldn't have put the
> investment they have into the Windows installer in recent months
> (auto detection of 32 or 64 bit JRE, greater control over ports,
> multiple service installs of the same version, ...)
> 
>> With regard to finding a solution, I'll try the antiJarLocking 
>> setting, but I don't have any problem with any other JARS, so I
>> don't hold out much hope for this fixing my problem.  I may look at
>>  upgrading to JDK 7 - which has added a "close" method to the 
>> URLClassLoader.  Perhaps this might fix it.
> 
> Maybe.
> 
>> If anyone else has any other ideas why ONLY JARs added via the
>> addURL "hack" I've shown below don't get unloaded when the WEBAPP
>> is shutdown - vs stopping Tomcat completely, I would greatly
>> appreciate it.
> 
> You need to understand the root cause. I'd recommend getting a
> profiler (I use YourKit since they give free copies to Tomcat
> committers) and finding out exactly what is holding references to
> those JARs. Once you know that the next questions are 1. What creates
> those references and 2. How to get rid of them.
> 
> Mark
> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> -
>
> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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



RE: JAR locked in Tomcat after using addUrl to dynamically add JAR to running webapp

2011-10-21 Thread Bob DeRemer
Hi Mark,

With regard to using Tomcat in production, that was meant sarcastically - the 
team has done a nice job on later Tomcat 6 and Tomcat 7 32/64-bit installations 
- including Windows Service support, etc. - nice work.

With regard to using YourKit, I have a licensed copy, but must be missing 
something - where can I look to see what is holding a reference to the JAR?  
I've used it for memory analysis and CPU profiling - primarily, but I'm not 
sure where to look for JAR references.

Thanks,
Bob

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Friday, October 21, 2011 2:46 AM
To: Tomcat Users List
Subject: Re: JAR locked in Tomcat after using addUrl to dynamically add JAR to 
running webapp

On 21/10/2011 03:00, Bob DeRemer wrote:
> While I can appreciate the desire to never use Windows, that isn't 
> reality in many of the industries that use our product, so running 
> Tomcat on windows can't be considered an oddity or edge case.  If it 
> is, we better look for another app server.

If that were the case, the Tomcat devs wouldn't have put the investment they 
have into the Windows installer in recent months (auto detection of
32 or 64 bit JRE, greater control over ports, multiple service installs of the 
same version, ...)

> With regard to finding a solution, I'll try the antiJarLocking 
> setting, but I don't have any problem with any other JARS, so I don't 
> hold out much hope for this fixing my problem.  I may look at 
> upgrading to JDK 7 - which has added a "close" method to the 
> URLClassLoader.  Perhaps this might fix it.

Maybe.

> If anyone else has any other ideas why ONLY JARs added via the addURL 
> "hack" I've shown below don't get unloaded when the WEBAPP is shutdown 
> - vs stopping Tomcat completely, I would greatly appreciate it.

You need to understand the root cause. I'd recommend getting a profiler (I use 
YourKit since they give free copies to Tomcat committers) and finding out 
exactly what is holding references to those JARs. Once you know that the next 
questions are 1. What creates those references and 2.
How to get rid of them.

Mark

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


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



Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread Mark Thomas
On 21/10/2011 11:42, André Warnier wrote:
> Allright, so how about a half-way house to start with ?
> Keep the list in some thread-safe table, indexed by session-id, and just
> scan the table.
> Updating the corresponding session entry at each request should be cheap.
> 
> Of course in all this, my basic assumption is that currently, Tomcat
> keeps session information (including the expiration data) in some
> location which requires an I/O action to access.

That assumption is incorrect. Which pretty much invalidates the rest of
the points below.

Again, I *strongly* encourage you to look at the current implementation
before suggesting improvements.

Mark


> If so, an immediate benefit of having a table in memory, may be that
> when a request comes in with a session-id, the check of whether this
> session-id is still valid may be speeded up significantly (as opposed to
> try to actually "get" the session info through an I/O and maybe
> failing). And even if found in the table, the check on the expiration
> time would be quick too.  And if it is expired, deleting the entry from
> the table, and deleting the session info through an I/O, may still be
> faster than first retrieving the session info from disk.
> 
> Re-thinking about the above, an easier way to achieve a similar effect,
> may be to arrange to store all session info onto something like a
> RAM-disk of course.
> 
> Basically my feeling is this : assuming for example 1000 on-going
> sessions, the background thread needs to do at least 1000 I/O's (and
> probably many more) each time it checks for session expiration. And this
> only to compare "now" with the session's expiration data.
> Intuitively, this seems like a significant waste of I/O bandwidth, which
> could be avoided at the cost of a bit of RAM.
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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



Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread André Warnier

Mark Thomas wrote:

On 21/10/2011 10:05, André Warnier wrote:

I am assuming that at each access to the application, Tomcat updates the
expiration time of the session if any (that is, it sets a new date/time
at which this session will be considered as expired, being "now" +
timeout).


Rather than making incorrect assumptions, you could check the source code.


So Tomcat, at any time, could maintain an ordered list of sessions with
their timeout timestamps (sorted by increasing expiration timestamp).


That is do-able.


Now whenever the background thread goes into its "check for expired
sessions" cycle, it could start at the beginning of the sorted list, and
stop as soon as it encounters an entry with an expiration time which is
later than "now", because any entry beyond that point is of course
unexpired.

The sorted list needs to contain only the session-id and current
expiration timestamp, so it should not be that costly in terms of
memory. (*)

In my personal experience, systems nowadays tend to be limited more by
their disk I/O speed than by CPU usage.  Despite the more complex logic
required by keeping the ordered list ordered, and considering that
sessions are usually created/kept for a "considerable" length of time, I
have a feeling that this might provide a performance boost, all the more
important as the number of sessions increases.
Also, when checking a session for expiration, Tomcat would not actually
need to read each session's info to get its expiration time and decide
to delete the session. It could just check the entry in the list, and
delete the session info immediately if it is expired, without needing to
read it.


With this approach the question is which is faster:
a) iterating all of the sessions once a minute (or frequency of choice)
and discarding all those with (now - last accessed) > timeout
b) maintaining a list of sessions ordered by expiration time which is
updated on every request associated with a session

I have a hard time believing that:
1. b) isn't significantly more expensive
2. b) doesn't have all sorts of issues in a multi-threaded environment

Hard data will convince me otherwise but at this point I suspect b) is
considerably worse.


Allright, so how about a half-way house to start with ?
Keep the list in some thread-safe table, indexed by session-id, and just scan 
the table.
Updating the corresponding session entry at each request should be cheap.

Of course in all this, my basic assumption is that currently, Tomcat keeps session 
information (including the expiration data) in some location which requires an I/O action 
to access.
If so, an immediate benefit of having a table in memory, may be that when a request comes 
in with a session-id, the check of whether this session-id is still valid may be speeded 
up significantly (as opposed to try to actually "get" the session info through an I/O and 
maybe failing). And even if found in the table, the check on the expiration time would be 
quick too.  And if it is expired, deleting the entry from the table, and deleting the 
session info through an I/O, may still be faster than first retrieving the session info 
from disk.


Re-thinking about the above, an easier way to achieve a similar effect, may be to arrange 
to store all session info onto something like a RAM-disk of course.


Basically my feeling is this : assuming for example 1000 on-going sessions, the background 
thread needs to do at least 1000 I/O's (and probably many more) each time it checks for 
session expiration. And this only to compare "now" with the session's expiration data.
Intuitively, this seems like a significant waste of I/O bandwidth, which could be avoided 
at the cost of a bit of RAM.




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



Re: FarmWarDeployer undeploy on slave node when tomcat restart

2011-10-21 Thread Keiichi Fujino
I checked FarmWarDeployer's code.
When WAR is updated, FarmWarDeployer sends UndeployMessage and sends
FileMessage after that.
The node which received UndeployMessage undeploys war.
The node which received FileMessage deploys war.

If FileMessage is received while processing UndeployMessage, the
following error messages will be outputted.
"SEVERE: Application /example in used. touch war file example.war again!"

In the case of asynchronous replication (default), FileMessage may be
received while processing UndeployMessage.

I think that it may be better to process updated war by one message.
Although I consider correction of a code, there is one work around.

Workaround is change in synchronous mode.

Please try the following.



2011/10/21 Marco Betti :
> Tried also on Tomcat 7.0.22
>
> Same behaviour: when i restart node1, FarmWarDeployer undeploy my war both
> from node1 and node2, but re-deploy it only on node1.
> If I touch my war in my watchDir on node1, tomcat redeploys it correctly on
> both nodes...
>
> Is tomcat clustering used?
>
> If so, does anybody use FarmWarDeployer  ?
>
> Many thanks,
> Marco
>
>
>
> On Thu, Oct 20, 2011 at 6:21 PM, Marco Betti  wrote:
>
>> Hi all,
>> I'm new to the list.
>> I'm trying to configure tomcat 6.0.33 clustering.
>> Session replication is ok.
>> I've a problem with FarmWarDeployer.
>> I found that:
>>
>> 1. You have to place the  node under the  element.
>>
>> Tomcat 6.0.x complains that the element Cluster/Deployer element is not
>> understood at the Engine level.
>>
>> 2. One node needs to have watchEnabled="true", all other nodes
>> watchEnabled="false"
>>
>> 3. deployDir is the same as appBase
>>
>>
>> and after I found this post that confirmed these points to me:
>>
>> http://www.mail-archive.com/users@tomcat.apache.org/msg80374.html
>>
>> The problem is the following:
>> let node1 be the master (watchEnabled="true") and node2 the slave
>> (watchEnabled="false")
>> This is my configuration:
>> >
>> tempDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/temp/"
>>
>> deployDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/webapps/"
>>
>> watchDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/farm/"
>>                     watchEnabled="true"/>
>>
>>
>> If I copy a war to watchDir of node1 evertything works fine and cluster
>> deploy is achieved.
>>
>> When i restart node1, FarmWarDeployer undeploy my war both from node1 and
>> node2, but re-deploy it only on node1.
>>
>> node1 log:
>>
>> INFO: Cluster wide remove of web app /example
>> Oct 20, 2011 5:50:46 PM org.apache.catalina.startup.HostConfig
>> checkResources
>> INFO: Undeploying context [/example]
>> Oct 20, 2011 5:50:46 PM org.apache.catalina.startup.HostConfig deployWAR
>> INFO: Deploying web application archive example.war
>>
>>
>> node2 log:
>>
>> INFO: Undeploying context [/example]
>> Oct 20, 2011 5:50:47 PM org.apache.catalina.ha.deploy.FarmWarDeployer
>> messageReceived
>> SEVERE: Application /example in used. touch war file example.war again!
>>
>>
>> Obviously, if I touch my war in my watchDir on node1, tomcat redeploys it
>> correctly on both nodes... but this cannot be the solution...
>>
>>
>> Is it a known problem?
>>
>> Could anyone help me?
>>
>> Many thanks,
>> Marco
>>
>



-- 
Keiichi.Fujino

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



docBase="" and in server.xml

2011-10-21 Thread Gianoglio Gabriele
Hy everibody,

in my Tomcat 5.5 instance I'm trying to set a webapp as the root 
(docBase="") webapp so that when users connect to http://server:port/ will not 
respond "manager" webapp. I've done this by adding the tag  in server.xml, but I can't access this webapp because 
 defined in context.xml can't access  defined in 
server.xml.

I can I solve this problem?

Thanks.

Gabriele.


Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread Mark Thomas
On 21/10/2011 10:05, André Warnier wrote:
> I am assuming that at each access to the application, Tomcat updates the
> expiration time of the session if any (that is, it sets a new date/time
> at which this session will be considered as expired, being "now" +
> timeout).

Rather than making incorrect assumptions, you could check the source code.

> So Tomcat, at any time, could maintain an ordered list of sessions with
> their timeout timestamps (sorted by increasing expiration timestamp).

That is do-able.

> Now whenever the background thread goes into its "check for expired
> sessions" cycle, it could start at the beginning of the sorted list, and
> stop as soon as it encounters an entry with an expiration time which is
> later than "now", because any entry beyond that point is of course
> unexpired.
> 
> The sorted list needs to contain only the session-id and current
> expiration timestamp, so it should not be that costly in terms of
> memory. (*)
> 
> In my personal experience, systems nowadays tend to be limited more by
> their disk I/O speed than by CPU usage.  Despite the more complex logic
> required by keeping the ordered list ordered, and considering that
> sessions are usually created/kept for a "considerable" length of time, I
> have a feeling that this might provide a performance boost, all the more
> important as the number of sessions increases.
> Also, when checking a session for expiration, Tomcat would not actually
> need to read each session's info to get its expiration time and decide
> to delete the session. It could just check the entry in the list, and
> delete the session info immediately if it is expired, without needing to
> read it.

With this approach the question is which is faster:
a) iterating all of the sessions once a minute (or frequency of choice)
and discarding all those with (now - last accessed) > timeout
b) maintaining a list of sessions ordered by expiration time which is
updated on every request associated with a session

I have a hard time believing that:
1. b) isn't significantly more expensive
2. b) doesn't have all sorts of issues in a multi-threaded environment

Hard data will convince me otherwise but at this point I suspect b) is
considerably worse.

Mark

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



Re: Undeploy fails with Tomcat 7 manager application

2011-10-21 Thread Mark Thomas
On 21/10/2011 09:58, Mike wrote:
> Mark Thomas  apache.org> writes:
> 
>>
>> On 18/10/2011 13:02, Bjoern Raupach wrote:
>>> Hi group,
>>>
>>> we are using Tomcat 7.0.21 on Windows XP with the manager application for 
> remote deployment.  Tomcat is
>> configured to unpack wars. Deploying works. However undeploy fails for the 
> following reason:
>>> FAIL - Unable to delete [C:\Programme\Apache Software Foundation\Tomcat 7.0
> \webapps\mywebapp]. The
>> continued presence of this file may cause problems.
>>> The exploded WAR file mywebapp is still in the webapp folder. The war file 
> gets deleted. Now, we can't even
>> redeploy or deploy. We have to manually delete the folder mywebapp.
>>>
>>> Any ideas?
>>
>> Fix the memory leaks that are causing one or more files to be left open
>> in the unpacked web application.
>>
>> Mark
>>
> 
> Hello,
> 
> I am too having this problem because the logfile which is created by log4j 
> cannot be deleted since tomcat7 is still accessing it. I don't think this 
> would be called a memory leak!? Even when trying to delete it manually in the 
> file browser it doesn't work. After tomcat is stopped the logfile can be 
> deleted manually.
> 
> Is this a bug or can it somehow be fixed?

Where is the log file created? Why are you trying to delete it?

Mark

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



Re: [OT?] control of session timed out with tomcat

2011-10-21 Thread André Warnier

Mark Thomas wrote:

On 20/10/2011 17:01, Tim Watts wrote:

On Thu, 2011-10-20 at 16:35 +0100, Mark Thomas wrote:

On 20/10/2011 16:22, André Warnier wrote:

Hassan Schroeder wrote:

On Thu, Oct 20, 2011 at 7:52 AM, André Warnier  wrote:


1) Tomcat (probably) doesn't spend its time all the time scanning stored
sessions to see if one has expired, and deleting it.

Actually, it does. That's what session listeners depend on.

So, for example, I can have a ShoppingCart with a method like

public void valueUnbound(HttpSessionBindingEvent httpsessionbindingevent)
{
 empty(); /* remove reserved status from items */
}

If the session times out without the cart contents being purchased,
the cart returns any items it contains to inventory. Very handy :-)


You mean that if there are 500 sessions active, Tomcat spends its time
checking all of them repeatedly on the off-chance that one has expired ?

It is handled by the background processing thread. By default that
thread runs every 10 seconds and ManagerBase triggers a session
expiration check every 6 runs by default. So in short, they are checked
roughly every 60s. The test is pretty simple so it doesn't take very
long at all.


Or is there a smarter algorithm implemented there ?

Such as? I'm open to ideas here (maybe not for this exact problem but
certainly the general one).


Not necessarily claiming "better" but:
  * find the oldest session


This can change dynamically since application code can change the
session expiration time at any point.


  * go to sleep until it's ready to expire (since you know nothing
interesting will happen before then)
  * wake up and expire sessions that need expiring
  * repeat

Of course, this would require a dedicated thread. If the background
thread handles more tasks than just expiring sessions there's probably
not much gain in doing this approach. Or you could use the 'find oldest
session' value to compute how many work cycles to skip until the next
actual check. Is the complexity worth the savings in CPU cycles? Eh,
probably a wash. Could set a minimum threshold and only use the computed
value if it's greater than the threshold. Incorporate the computation as
part of the session scan.

But you did ask... :-)


If session expiration time was constant, this would be fine.
Unfortunately, that is not the case.



How about..

I am assuming that at each access to the application, Tomcat updates the expiration time 
of the session if any (that is, it sets a new date/time at which this session will be 
considered as expired, being "now" + timeout).


So Tomcat, at any time, could maintain an ordered list of sessions with their timeout 
timestamps (sorted by increasing expiration timestamp).


Now whenever the background thread goes into its "check for expired sessions" cycle, it 
could start at the beginning of the sorted list, and stop as soon as it encounters an 
entry with an expiration time which is later than "now", because any entry beyond that 
point is of course unexpired.


The sorted list needs to contain only the session-id and current expiration timestamp, so 
it should not be that costly in terms of memory. (*)


In my personal experience, systems nowadays tend to be limited more by their disk I/O 
speed than by CPU usage.  Despite the more complex logic required by keeping the ordered 
list ordered, and considering that sessions are usually created/kept for a "considerable" 
length of time, I have a feeling that this might provide a performance boost, all the more 
important as the number of sessions increases.
Also, when checking a session for expiration, Tomcat would not actually need to read each 
session's info to get its expiration time and decide to delete the session. It could just 
check the entry in the list, and delete the session info immediately if it is expired, 
without needing to read it.


(*) I would even not be surprised if there existed already in memory some form of table 
representing the current sessions.







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



Re: Undeploy fails with Tomcat 7 manager application

2011-10-21 Thread Mike
Mark Thomas  apache.org> writes:

> 
> On 18/10/2011 13:02, Bjoern Raupach wrote:
> > Hi group,
> > 
> > we are using Tomcat 7.0.21 on Windows XP with the manager application for 
remote deployment.  Tomcat is
> configured to unpack wars. Deploying works. However undeploy fails for the 
following reason:
> > FAIL - Unable to delete [C:\Programme\Apache Software Foundation\Tomcat 7.0
\webapps\mywebapp]. The
> continued presence of this file may cause problems.
> > The exploded WAR file mywebapp is still in the webapp folder. The war file 
gets deleted. Now, we can't even
> redeploy or deploy. We have to manually delete the folder mywebapp.
> > 
> > Any ideas?
> 
> Fix the memory leaks that are causing one or more files to be left open
> in the unpacked web application.
> 
> Mark
> 

Hello,

I am too having this problem because the logfile which is created by log4j 
cannot be deleted since tomcat7 is still accessing it. I don't think this 
would be called a memory leak!? Even when trying to delete it manually in the 
file browser it doesn't work. After tomcat is stopped the logfile can be 
deleted manually.

Is this a bug or can it somehow be fixed?

Regards,

Mike






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



Re: FarmWarDeployer undeploy on slave node when tomcat restart

2011-10-21 Thread Marco Betti
Tried also on Tomcat 7.0.22

Same behaviour: when i restart node1, FarmWarDeployer undeploy my war both
from node1 and node2, but re-deploy it only on node1.
If I touch my war in my watchDir on node1, tomcat redeploys it correctly on
both nodes...

Is tomcat clustering used?

If so, does anybody use FarmWarDeployer  ?

Many thanks,
Marco



On Thu, Oct 20, 2011 at 6:21 PM, Marco Betti  wrote:

> Hi all,
> I'm new to the list.
> I'm trying to configure tomcat 6.0.33 clustering.
> Session replication is ok.
> I've a problem with FarmWarDeployer.
> I found that:
>
> 1. You have to place the  node under the  element.
>
> Tomcat 6.0.x complains that the element Cluster/Deployer element is not
> understood at the Engine level.
>
> 2. One node needs to have watchEnabled="true", all other nodes
> watchEnabled="false"
>
> 3. deployDir is the same as appBase
>
>
> and after I found this post that confirmed these points to me:
>
> http://www.mail-archive.com/users@tomcat.apache.org/msg80374.html
>
> The problem is the following:
> let node1 be the master (watchEnabled="true") and node2 the slave
> (watchEnabled="false")
> This is my configuration:
> 
> tempDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/temp/"
>
> deployDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/webapps/"
>
> watchDir="/appserv/tomcat/tomcat60/apache-tomcat-6.0.33/server/clu001node01/farm/"
> watchEnabled="true"/>
>
>
> If I copy a war to watchDir of node1 evertything works fine and cluster
> deploy is achieved.
>
> When i restart node1, FarmWarDeployer undeploy my war both from node1 and
> node2, but re-deploy it only on node1.
>
> node1 log:
>
> INFO: Cluster wide remove of web app /example
> Oct 20, 2011 5:50:46 PM org.apache.catalina.startup.HostConfig
> checkResources
> INFO: Undeploying context [/example]
> Oct 20, 2011 5:50:46 PM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive example.war
>
>
> node2 log:
>
> INFO: Undeploying context [/example]
> Oct 20, 2011 5:50:47 PM org.apache.catalina.ha.deploy.FarmWarDeployer
> messageReceived
> SEVERE: Application /example in used. touch war file example.war again!
>
>
> Obviously, if I touch my war in my watchDir on node1, tomcat redeploys it
> correctly on both nodes... but this cannot be the solution...
>
>
> Is it a known problem?
>
> Could anyone help me?
>
> Many thanks,
> Marco
>