You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Timothy Collett <da...@mac.com> on 2006/12/01 14:37:56 UTC

Re: Webapps inexplicably losing access to common/shared classloaders

Now, this seems to happen *every* time I stop and restart Tomcat...

I'm somewhat at a loss to see what could be put into a bad state by  
stopping and restarting Tomcat, but put back in a good state by  
restarting the computer.  Shouldn't everything be cleaned up by  
stopping Tomcat, or not cleaned up at all?

Once again, I would greatly appreciate help from anyone with *any*  
insight into this--especially if you can tell me I'm being an idiot,  
it's obviously (X setting)...

Thank you.

Timothy Collett

--

He who asks is a fool for five minues. He who doesn't ask is a fool  
forever.


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


Re: Webapps inexplicably losing access to common/shared classloaders

Posted by David Smith <dn...@cornell.edu>.
Caldarale, Charles R wrote:
>> From: David Smith [mailto:dns4@cornell.edu] 
>> Subject: Re: Webapps inexplicably losing access to 
>> common/shared classloaders
>>
>> Hmmmm..... only fixed by a system restart?  This sounds like an 
>> environment variable is changed during start or stop and the 
>> new value is bad.  Your start and stop scripts aren't attempting
>> to set classpath or something evil like that are they?
>>     
>
> Can't be that specifically, since the CLASSPATH environment variable
> isn't used by the JVM proper, just the launcher in the absence of the
> -cp parameter.  Probably not any other environment variables, since
> (AFAIK) Tomcat's classloaders don't look at any.  However, it might be
> interesting to compare the system properties visible to Tomcat after a
> reboot with those after a Tomcat restart.  The LambdaProbe add-on can
> display them, for example.  Turning on -verbose:class might also provide
> some hints, but it will produce a lot of output.
>
>  - Chuck
>
>   
I'd agree in 99.999% of all cases, but there is always that 0.001% case 
to really throw a monkey wrench in the works.  And I think we are 
looking at it.  It might be worthwhile for testing to simply add some 
echo statements to the start and stop scripts to see what the 
environment looks at those moments.

--David

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


RE: Webapps inexplicably losing access to common/shared classloaders

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: David Smith [mailto:dns4@cornell.edu] 
> Subject: Re: Webapps inexplicably losing access to 
> common/shared classloaders
> 
> Hmmmm..... only fixed by a system restart?  This sounds like an 
> environment variable is changed during start or stop and the 
> new value is bad.  Your start and stop scripts aren't attempting
> to set classpath or something evil like that are they?

Can't be that specifically, since the CLASSPATH environment variable
isn't used by the JVM proper, just the launcher in the absence of the
-cp parameter.  Probably not any other environment variables, since
(AFAIK) Tomcat's classloaders don't look at any.  However, it might be
interesting to compare the system properties visible to Tomcat after a
reboot with those after a Tomcat restart.  The LambdaProbe add-on can
display them, for example.  Turning on -verbose:class might also provide
some hints, but it will produce a lot of output.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Webapps inexplicably losing access to common/shared classloaders

Posted by David Smith <dn...@cornell.edu>.
Timothy Collett wrote:
> Now, this seems to happen *every* time I stop and restart Tomcat...
>
> I'm somewhat at a loss to see what could be put into a bad state by 
> stopping and restarting Tomcat, but put back in a good state by 
> restarting the computer.  Shouldn't everything be cleaned up by 
> stopping Tomcat, or not cleaned up at all?
>

Hmmmm..... only fixed by a system restart?  This sounds like an 
environment variable is changed during start or stop and the new value 
is bad.  Your start and stop scripts aren't attempting to set classpath 
or something evil like that are they?

--David

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


Re: Webapps inexplicably losing access to common/shared classloaders

Posted by Timothy Collett <da...@mac.com>.
On Dec 1, 2006, at 10:35 AM, Caldarale, Charles R wrote:
> Do you have servlet-api.jar in more than one place?  It must only  
> be in
> common/lib, and nowhere else.  You can also get the above error if
> HttpServlet.class is packaged in some other jar.

Nope, it's only there.  I even unzipped every single jar in the  
webapp's WEB-INF folder to see if any of them had HttpServlet.class  
in them, and they didn't...

Also, it wouldn't explain why my other webapp is unable to see the  
MySQL driver jar in its own WEB-INF/lib folder...

Also, another interesting update: I downloaded Eclipse and the Sysdeo  
Tomcat plugin, to see if I could debug the problem, and starting  
Tomcat from within Eclipse doesn't seem to trigger the problem--at  
least not yet.

Timothy Collett

--

"The hardest thing in this world is to live in it."
--Buffy Anne Summers


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


RE: Webapps inexplicably losing access to common/shared classloaders

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Timothy Collett [mailto:danaris@mac.com] 
> Subject: Re: Webapps inexplicably losing access to 
> common/shared classloaders
> 
> Dec 1, 2006 8:54:05 AM org.apache.catalina.startup.HostConfig  
> deployDirectory
> SEVERE: Error deploying web application directory WCMS-Online
> java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet

Do you have servlet-api.jar in more than one place?  It must only be in
common/lib, and nowhere else.  You can also get the above error if
HttpServlet.class is packaged in some other jar.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Webapps inexplicably losing access to common/shared classloaders

Posted by Timothy Collett <da...@mac.com>.
On Dec 1, 2006, at 10:00 AM, Caldarale, Charles R wrote:
> Agreed, not if this is all happening within one process.  Any chance
> some thread in one of your webapps is changing the current  
> directory for
> the process?  That can result in rather strange and erratic behavior,
> depending on which classloaders have already opened the libraries of
> interest.

I don't think so...the problem happens right as it tries to load my  
primary webapp:

Dec 1, 2006 8:54:05 AM org.apache.catalina.startup.HostConfig  
deployDirectory
SEVERE: Error deploying web application directory WCMS-Online
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	at java.security.SecureClassLoader.defineClass 
(SecureClassLoader.java:124)
	...

Also, changing the current directory isn't something I know how to do  
offhand, nor something I think I've ever had a project do, so I don't  
know how it would be happening...

Aside from my primary webapp, and a second one (which loads  
afterwards, and is actually in a separate <Host>), all the webapps  
are Tomcat's standard-shipped ones...

Timothy Collett

--

"You know, Hobbes, some days even my lucky rocketship underpants  
don't help"
  -- Calvin



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


RE: Webapps inexplicably losing access to common/shared classloaders

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Timothy Collett [mailto:danaris@mac.com] 
> Subject: Re: Webapps inexplicably losing access to 
> common/shared classloaders
> 
> I did check, but I don't see how any permissions setup could 
> possibly create this situation...

Agreed, not if this is all happening within one process.  Any chance
some thread in one of your webapps is changing the current directory for
the process?  That can result in rather strange and erratic behavior,
depending on which classloaders have already opened the libraries of
interest.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Webapps inexplicably losing access to common/shared classloaders

Posted by Timothy Collett <da...@mac.com>.
On Dec 1, 2006, at 8:45 AM, Caldarale, Charles R wrote:

>> From: Timothy Collett [mailto:danaris@mac.com]
>> Subject: Re: Webapps inexplicably losing access to
>> common/shared classloaders
>>
>> Now, this seems to happen *every* time I stop and restart Tomcat...
>
> Does anything happen to the access permissions or other security
> attributes of the common and shared directories (and sub-directories)
> while Tomcat is running?  And perhaps these are restored to normal  
> when
> the system is rebooted?  Are there any symlinks involved?

There are no symlinks involved, I'm 95% sure nothing happens to the  
permissions--and different webapps are seeing different things!

One webapp (my main one) cannot see servlet-api.jar in common/lib.
Another cannot see the MySQL driver jar in its WEB-INF/lib folder,  
but *can* see servlet-api.jar.
The provided webapps (eg, servlets-examples) seem to work just fine.

I did check, but I don't see how any permissions setup could possibly  
create this situation...

Timothy Collett

--

For every complex problem there is an answer that is clear, simple,  
and wrong.
-- H L Mencken


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


RE: Webapps inexplicably losing access to common/shared classloaders

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Timothy Collett [mailto:danaris@mac.com] 
> Subject: Re: Webapps inexplicably losing access to 
> common/shared classloaders
> 
> Now, this seems to happen *every* time I stop and restart Tomcat...

Does anything happen to the access permissions or other security
attributes of the common and shared directories (and sub-directories)
while Tomcat is running?  And perhaps these are restored to normal when
the system is rebooted?  Are there any symlinks involved?

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org