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/07/13 19:40:29 UTC

Frustrated by NoClassDefFound errors

Greetings.

I've been using Tomcat for some time now, but recently I started  
getting a series of intermittent NoClassDefFound errors.  They were  
first occurring with the Commons Configuration package (specifically,  
org.apache.commons.configuration.PropertiesConfiguration), though I  
was occasionally able to make those go away with some fiddling  
(unfortunately, I'm not quite sure just *which* fiddling it was that  
fixed it, aside from the times when I simply commented it out...).   
However, once that disappeared, I started having problems with the  
AspectJ package (org.aspectj.lang.Signature, being called from  
Class.forName).

In an effort to track down the problem, I created a fresh install of  
Tomcat, and it still cannot find the org.aspectj.lang.Signature.

The jars in question were all originally placed in the $CATALINA_HOME/ 
common/lib directory (after I did a little tidying up).  I've tried  
them in the shared/lib directory as well, to no avail.

I'm running Tomcat 5.5.17 on Mac OS X 10.4.7, with JDK 1.5.0_06.

Any help would be greatly appreciated.

Timothy Collett

--

Having been erased,
The document you're seeking
Must now be retyped.
~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: Frustrated by NoClassDefFound errors

Posted by Timothy Collett <da...@mac.com>.
On Jul 14, 2006, at 11:03 AM, Boris Unckel wrote:
> Great! For your experiments: Use shared/lib and not common/lib,  
> except if you really want to change something in the container...

Actually, one of the things I'm doing is making a subclass of  
Context, which handles some startup and shutdown stuff for another  
part of my project (a Jabber component), and I presume anything like  
that needs to be in common/lib or server/lib.

Again, I'm sure I'm doing a bunch of this stuff the hard way, and I'm  
completely open to better ways of doing things; this is just how I've  
managed to get it working for me ;-)

Timothy Collett

--

"Never try and teach a pig to sing, you waste your time and annoy the  
pig"
  - Mark Twain



---------------------------------------------------------------------
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: Frustrated by NoClassDefFound errors

Posted by Boris Unckel <bo...@gmx.net>.
Hi,
>
>>> However, even placing AspectJ in the webapp's WEB-INF/lib directory 
>>> gives me the same error.
>> Did you put everything or just AspectJ in webapp's WEB-INF/lib 
>> directory? Please have a try with everything.
>
> By "everything" do you mean the JDBC driver as well?  OK, I'll go try 
> that...
No, everything but the JDBC driver.
>
> ...
>
> Hey, whaddaya know, that time it worked :-)
>
Great! For your experiments: Use shared/lib and not common/lib, except 
if you really want to change something in the container...

Boris


---------------------------------------------------------------------
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: Frustrated by NoClassDefFound errors

Posted by Timothy Collett <da...@mac.com>.
On Jul 14, 2006, at 9:15 AM, Boris Unckel wrote:
> The vendor given JDBC-driver requires AspectJ? Which DataBase,  
> which driver? (this is just for my personal interest).

It's the standard MySQL driver.  If there's a way to get it to work  
without AspectJ, I'm all ears...I'm still pretty new at this (and was  
even moreso when I first started using the MySQL JDBC drivers...), so  
I may be doing some things the hard way.

>> Also, what I'm developing at the moment is intended to be a  
>> framework that can be used by multiple webapps at once, so common/ 
>> lib or shared/lib seemed to make sense...
> Even framework JARs should be deployed with the independent webapp.  
> Diskspace or ease of deployment are less important than errors  
> resulting from ClassLoader problems.

That's certainly true.  At the moment, I have my .java/.class files  
there for ease of development (not having to worry about just which  
copy of the file I'm editing...); however, if putting it all in the  
webapp will solve some problems...

>> However, even placing AspectJ in the webapp's WEB-INF/lib  
>> directory gives me the same error.
> Did you put everything or just AspectJ in webapp's WEB-INF/lib  
> directory? Please have a try with everything.

By "everything" do you mean the JDBC driver as well?  OK, I'll go try  
that...

...

Hey, whaddaya know, that time it worked :-)

Well, that's very interesting...not least because everything was  
working perfectly until a few days ago with the setup I described  
earlier.  Perhaps I need to experiment with various combinations...

Thanks a lot!

Timothy Collett

--

It is a miracle that curiosity survives formal education.
--Albert Einstein


---------------------------------------------------------------------
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: Frustrated by NoClassDefFound errors

Posted by Boris Unckel <bo...@gmx.net>.
Hello,
Timothy Collett wrote:
> On Jul 14, 2006, at 4:45 AM, Boris Unckel wrote:
>> The usage of common/lib or common/shared is generally not a good idea 
>> if you are not forced to do it (i.E. a JDBC-Driver).
>> Does AspectJ have the requirement to be in common/lib or shared/lib?
>> If not, try to put everything in your webapps/WEB-INF/lib directory. 
>> Even if this would mean to duplicate it for several webapps.
>> Please give feedback for the results (in positive and negative case)
>
> AspectJ is, in fact, required for my JDBC driver (at least, so it 
> appears).  
The vendor given JDBC-driver requires AspectJ? Which DataBase, which 
driver? (this is just for my personal interest).
> Also, what I'm developing at the moment is intended to be a framework 
> that can be used by multiple webapps at once, so common/lib or 
> shared/lib seemed to make sense...
Even framework JARs should be deployed with the independent webapp. 
Diskspace or ease of deployment are less important than errors resulting
from ClassLoader problems.
>
> However, even placing AspectJ in the webapp's WEB-INF/lib directory 
> gives me the same error.
Did you put everything or just AspectJ in webapp's WEB-INF/lib 
directory? Please have a try with everything.

Regards
Boris


---------------------------------------------------------------------
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: Frustrated by NoClassDefFound errors

Posted by Timothy Collett <da...@mac.com>.
On Jul 14, 2006, at 4:45 AM, Boris Unckel wrote:
> The usage of common/lib or common/shared is generally not a good  
> idea if you are not forced to do it (i.E. a JDBC-Driver).
> Does AspectJ have the requirement to be in common/lib or shared/lib?
> If not, try to put everything in your webapps/WEB-INF/lib  
> directory. Even if this would mean to duplicate it for several  
> webapps.
> Please give feedback for the results (in positive and negative case)

AspectJ is, in fact, required for my JDBC driver (at least, so it  
appears).  Also, what I'm developing at the moment is intended to be  
a framework that can be used by multiple webapps at once, so common/ 
lib or shared/lib seemed to make sense...

However, even placing AspectJ in the webapp's WEB-INF/lib directory  
gives me the same error.

Timothy Collett

--

"Far better it is to dare mighty things, to win glorious triumphs,  
even though checkered by failure, than to take rank with those poor  
spirits who neither enjoy much or suffer much, because they live in  
the gray twilight that knows not victory nor defeat."
  -T.R.


---------------------------------------------------------------------
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: Frustrated by NoClassDefFound errors

Posted by Boris Unckel <bo...@gmx.net>.
Hello Timothy,

Timothy Collett wrote:
> Greetings.
>
> I've been using Tomcat for some time now, but recently I started 
> getting a series of intermittent NoClassDefFound errors.  They were 
> first occurring with the Commons Configuration package (specifically, 
> org.apache.commons.configuration.PropertiesConfiguration), though I 
> was occasionally able to make those go away with some fiddling 
> (unfortunately, I'm not quite sure just *which* fiddling it was that 
> fixed it, aside from the times when I simply commented it out...).  
> However, once that disappeared, I started having problems with the 
> AspectJ package (org.aspectj.lang.Signature, being called from 
> Class.forName).
>
> In an effort to track down the problem, I created a fresh install of 
> Tomcat, and it still cannot find the org.aspectj.lang.Signature.
>
> The jars in question were all originally placed in the 
> $CATALINA_HOME/common/lib directory (after I did a little tidying 
> up).  I've tried them in the shared/lib directory as well, to no avail.
>
> I'm running Tomcat 5.5.17 on Mac OS X 10.4.7, with JDK 1.5.0_06.
The usage of common/lib or common/shared is generally not a good idea if 
you are not forced to do it (i.E. a JDBC-Driver).
Does AspectJ have the requirement to be in common/lib or shared/lib?
If not, try to put everything in your webapps/WEB-INF/lib directory. 
Even if this would mean to duplicate it for several webapps.
Please give feedback for the results (in positive and negative case)

Regards
Boris



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