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/11/07 17:32:24 UTC

Webapps inexplicably losing access to common/shared classloaders

Greetings.
I have been having a problem recently with webapps losing access to  
the shared classloader, or, worse, the common classloader.  It  
occurred apparently spontaneously a week ago, and I simply moved to a  
clean Tomcat container of 5.5.20 (I needed to upgrade anyway).  It's  
been working fine since.

However, this morning, one of my webapps cannot see the MySQL JDBC  
jar in the shared classloader...and another cannot see the servlet- 
api jar in the common classloader.  This makes it very difficult to  
actually do anything...

I have not modified either the common/lib, shared/lib, or <webapp>/ 
WEB-INF/lib directories since yesterday, when both these webapps were  
working just fine.  All I've done (that I can tell) is restarted  
Tomcat.  It was similar last week--everything was working OK, and for  
some reason I had to restart Tomcat, and it stopped working (one  
webapp couldn't find javax/servlet/http/HttpServlet).

I would greatly appreciate any help with this.

Timothy Collett

--

With searching comes loss
and the presence of absence:
"My Novel" not found.
~haiku~


---------------------------------------------------------------------
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


Re: Webapps inexplicably losing access to common/shared classloaders

Posted by Timothy Collett <da...@mac.com>.
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 Timothy Collett <da...@mac.com>.
On Nov 20, 2006, at 3:07 PM, Timothy Collett wrote:
> ...And, just as I suspected it would, it has once again ceased to  
> function in the 5.5.20 container.  One webapp can't see the shared  
> classloader (for the MySQL jar), and the other can't see the common  
> classloader (for the servlet-api jar).
>
> Does *anyone* have *any* idea about how this could even be  
> *possible*?  I'm willing to try just about anything at this point...

This time, I've managed to confirm that a restart of the computer  
it's on does (temporarily) fix the problem.

Timothy Collett
Anaris Family

--

"Hitotsu dake onegai ga arimasu!  Inakunatte shimatta hitotachi no  
koto.  Tokidoki de ii kara... omoidashite kudasai..."
  ~ Yuna ~ Final Fantasy X ~


---------------------------------------------------------------------
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 Nov 16, 2006, at 4:49 PM, Timothy Collett wrote:
> OK, I've moved it back to the 5.5.20 container I moved it from in  
> the first place for exactly the same issue (in between my 2  
> previous emails on this thread)...it's working OK so far, but I  
> have no particular reason to believe it will continue to do so.

...And, just as I suspected it would, it has once again ceased to  
function in the 5.5.20 container.  One webapp can't see the shared  
classloader (for the MySQL jar), and the other can't see the common  
classloader (for the servlet-api jar).

Does *anyone* have *any* idea about how this could even be  
*possible*?  I'm willing to try just about anything at this point...

Timothy Collett

--

What good are dreams if they stay in your head?
--Stephen Kennedy, creator of Project Majestic Mix


---------------------------------------------------------------------
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 Nov 15, 2006, at 5:12 PM, Caldarale, Charles R wrote:
> I hope you're aware that 6.0 is still highly experimental - the fact
> that it is downloadable has not even been officially announced.   
> You're
> pretty much on your own with that level at the moment.  That said,  
> there
> is a 6.0.1 at the download site.

OK, I've moved it back to the 5.5.20 container I moved it from in the  
first place for exactly the same issue (in between my 2 previous  
emails on this thread)...it's working OK so far, but I have no  
particular reason to believe it will continue to do so.

Timothy Collett

--

"It may be doubted whether human ingenuity can construct an enigma of  
this kind which human ingenuity may not, by proper application, resolve"
     ~Edgar Allen Poe


---------------------------------------------------------------------
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
> 
> Well, it seems to have happened once again, this time in Tomcat  
> 6.0.0

I hope you're aware that 6.0 is still highly experimental - the fact
that it is downloadable has not even been officially announced.  You're
pretty much on your own with that level at the moment.  That said, there
is a 6.0.1 at the download site.

 - 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>.
Well, it seems to have happened once again, this time in Tomcat  
6.0.0, and it's not even being able to see the MySQL driver when I  
put the jar in the webapp's WEB-INF/lib folder.  Once again, it was  
working fine before I restarted Tomcat, and afterwards, it was not.

I would very much appreciate some help with this, even if it's just  
some massively stupid mistake I am making.  It seems to be somehow  
related to my test box's setup, since I've never seen it happen on  
the production machine--which is a good thing, but it's still  
incredibly frustrating...not to mention the fact that if I don't know  
why it's happening, I might end up making it happen on the production  
machine too.

Thanks to anyone who's able to help...

Timothy Collett

--

A file that big?
It might be very useful.
But now it is gone.
~haiku~


---------------------------------------------------------------------
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