tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Williams, Allen" <>
Subject Re: Can't find classes in jar files in WEB-INF
Date Tue, 20 Feb 2007 15:32:27 GMT
> No.... just got busy with work.  Given what you provided in your last
> post, it seems to come down to permissions or something overlooked.

> Are you running the security manager?

I don't think so.  I'm rather new to this (this is the first webapp I've
attempted to deploy), but I don't see anything in my server.xml that
indicate such.  What should I look for?

> Have you checked file permissions?

File permissions are rwxr-xr-x, owned by root.  I think I tried chmod
777 already,
but can try it again if you think it may be a permissions problem.

> Did you restart tomcat (or at least restart the webapp) after building
> the .jar file and placing it in WEB-INF/lib?

Yes, restarted tomcat.

> Are there any messages in the logs when your webapp starts that might
> indicate a problem?

Just the one about not finding my CheckUser filter.  However, I have
noticed that the CheckUser
filter is declared way down in my web.xml file, so am wondering if it is
finding the servlets OK,
and just has a problem with this filter.  It has no problem with it in
the classes subdir, so I didn't
think of that at first.

I had just assumed that it was looking for the filter first, so that was
why it was the only message
I got.  Then, I checked the web.xml file and wondered about this.  Here
is its declaration in web.xml,
along with the preceding servlet:

<!-- Filters Here -->
<!-- Now, set up the database stuff -->

> --David

Thanks so much!!

aladdin wrote:
> Have we given up here?  Do I need to have the packages in separate
> On Monday 19 February 2007 08:02, David Smith wrote:
>> You don't need to tell tomcat to look in WEB-INF/lib/*.jar.  Tomcat
>> that automatically per spec.  I'm guessing there is something wrong
>> the way your jar was created or a permissions problem.
>> Try testing the jar with
>> $JAVA_HOME/bin/jar tf whatever.jar
>> (linux/maxos syntax)
>> or
>> %JAVA_HOME\bin\jar tf whatever.jar
>> (windows syntax)
>> to be sure it's valid.  The command above lists all the files in the
>> file.  Then be sure permissions are set so the user tomcat runs as
>> read it.  One last thing to look for is any errors further up in the
>> logs above the class not found exception.
>> --David
>> aladdin wrote:
>>> Thanks for the tip!
>>> I don't think I'd have a conflict with all the classes in my
>>> Although some of my classes have common names, like
>>> of course, to user.class), they are all member of just one of three
>>> packages: infoisland, dbMgr, and utils, so I don't think the names
>>> colliding. Loading the app bombs out as tomcat is loading when it
>>> find my filter, CheckUser (makes sure users are logged in), which is
>>> the infoIsland package.
>>> However, your comment is telling: "WEB-INF itself is not checked or
>>> scanned for .jar files at all."  So, if I make sure the
>>> subdirectory is empty, how do I tell tomcat to go get classes out of
>>> WEB-INF/lib/whatever.jar file?
>>> Thanks.
>>> On Sunday 18 February 2007 20:05, David Smith wrote:
>>>> It should be noted there are only a couple of places .jar files are
>>>> allowed in tomcat:
>>>> 1. WEB-INF/lib
>>>> 2. common/lib of the tomcat installation directory
>>>> WEB-INF itself is not checked or scanned for .jar files at all.  In
>>>> addition, any files in the classes directory will override their
>>>> equivalent in the lib directory.  This occurs regardless of it
being in
>>>> WEB-INF/classes or common/classes
>>>> As to the issue below, are you sure you don't have similar classes
>>>> name and package) in both common/lib and WEB-INF/lib?  Seems like
>>>> there's a classloader issue at work here.  Take a look at the
>>>> classloader howto at
>>>> might offer some ideas.
>>>> --David
>>>> aladdin wrote:
>>>>> When I put my webapp.jar file in the WEB-INF directory, it doesn't
>>>>> the app.  When I exploded it into the classes directory, and
>>>>> subdirectories, they are found fine, but I get this problem (the
>>>>> below).
>>>>> This, it turns out, is triggered by the fact I have the webapp.jar
>>>>> in the lib directory and all the classes unpacked in the classes
>>>>> directory (both under WEB-INF, of course).  Getting rid of the
>>>>> webapp.jar file in the lib directory solves the problem below, but
>>>>> tomcat won't use that the jar file in the lib directory, even
>>>>> when it's unpacked in the classes directory, he seems perfectly
>>>>> Is there some magic I need for tomcat to use .jar files in the
>>>>> WEB-INF/lib directory, like an entry in web.xml or server.xml?
>>>>> On Friday 16 February 2007 22:52, aladdin wrote:
>>>>>> I was getting a message like "SEVERE PersistenceManager
>>>>>> not enabled", or something like that (I don't remember) so I
>>>>>> (commented out) the Manager tag in server.xml that configured the
>>>>>> PersistenceManager. Now, I'm getting
>>>>>> Feb 16, 2007 9:26:34 PM
>>>>>> modified INFO:     Additional JARs have been added
>>>>>> Feb 16, 2007 9:26:34 PM org.apache.catalina.core.StandardContext
>>>>>> reload INFO: Reloading this Context has started
>>>>>> over and over in the log files.  Anyone know what's causing this?
>>>>>> thought maybe tomcat was restarting, but the PID doesn't change.
>>>>>> seems to work, but it's filling up my log files.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message