You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by aladdin <al...@csunv.com> on 2007/02/17 18:24:56 UTC

Can't find classes in jar files in WEB-INF (was: Recurring (looping?) error messages)

When I put my webapp.jar file in the WEB-INF directory, it doesn't find the 
app.  When I exploded it into the classes directory, and associated 
subdirectories, they are found fine, but I get this problem (the one below).

This, it turns out, is triggered by the fact I have the webapp.jar file 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 now tomcat won't use that the jar 
file in the lib directory, even though when it's unpacked in the classes 
directory, he seems perfectly happy.  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 persistence not
> enabled", or something like that (I don't remember) so I disabled
> (commented out) the Manager tag in server.xml that configured the
> PersistenceManager. Now, I'm getting
>
> Feb 16, 2007 9:26:34 PM org.apache.catalina.loader.WebappClassLoader
> 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?  I
> thought maybe tomcat was restarting, but the PID doesn't change.  It seems
> to work, but it's filling up my log files.
>
> TIA
>
> ---------------------------------------------------------------------
> 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

---------------------------------------------------------------------
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: Can't find classes in jar files in WEB-INF

Posted by aladdin <al...@csunv.com>.
Here's a snippet of my web.xml that shows the filter:


  <servlet>
      <servlet-name>ReqMgr</servlet-name>
      <servlet-class>infoIsland.ReqMgr</servlet-class>
  </servlet>
  <servlet-mapping>
      <servlet-name>ReqMgr</servlet-name>
      <url-pattern>/members/servlet/ReqMgr</url-pattern>
  </servlet-mapping>

  <!-- Filters Here -->
  <filter>
    <filter-name>CheckUser</filter-name>
    <filter-class>infoIsland.CheckUser</filter-class>
    <init-param>
      <param-name>loginPage</param-name>
      <param-value>/login.jsp</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>CheckUser</filter-name>
    <url-pattern>/members/*</url-pattern>
  </filter-mapping>

Interesting, though, the filter is AFTER the servlet.  Does that mean tomcat 
is finding them?

However, it all works when the classes are exploded, filters, servlets, & all.

I've tried the jar -tvf, and it works OK.  In fact, I just jar 'em up right 
from the WEB-INF/classes directory, move 'em over to lib, and delete the 
directories underneath classes.  That's the way I produce the jar.  Is there 
something supposed to be in it that I'm missing?

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 does
> that automatically per spec.  I'm guessing there is something wrong with
> 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 jar
> file.  Then be sure permissions are set so the user tomcat runs as can
> 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 application.
> >Although some of my classes have common names, like user.java (compiled,
> >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 are
> > colliding. Loading the app bombs out as tomcat is loading when it can't
> > find my filter, CheckUser (makes sure users are logged in), which is in
> > 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 WEB-INF/classes
> > subdirectory is empty, how do I tell tomcat to go get classes out of the
> >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 (in
> >>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
> >>http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.  It
> >>might offer some ideas.
> >>
> >>--David
> >>
> >>aladdin wrote:
> >>>When I put my webapp.jar file in the WEB-INF directory, it doesn't find
> >>>the app.  When I exploded it into the classes directory, and associated
> >>>subdirectories, they are found fine, but I get this problem (the one
> >>>below).
> >>>
> >>>This, it turns out, is triggered by the fact I have the webapp.jar file
> >>>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 now
> >>> tomcat won't use that the jar file in the lib directory, even though
> >>> when it's unpacked in the classes directory, he seems perfectly happy. 
> >>> 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 persistence not
> >>>>enabled", or something like that (I don't remember) so I disabled
> >>>>(commented out) the Manager tag in server.xml that configured the
> >>>>PersistenceManager. Now, I'm getting
> >>>>
> >>>>Feb 16, 2007 9:26:34 PM org.apache.catalina.loader.WebappClassLoader
> >>>>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?  I
> >>>>thought maybe tomcat was restarting, but the PID doesn't change.  It
> >>>>seems to work, but it's filling up my log files.
> >>>>
> >>>>TIA
>
> ---------------------------------------------------------------------
> 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

---------------------------------------------------------------------
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: Can't find classes in jar files in WEB-INF

Posted by David Smith <dn...@cornell.edu>.
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? 
Have you checked file permissions? 
Did you restart tomcat (or at least restart the webapp) after building 
the .jar file and placing it in WEB-INF/lib?
Are there any messages in the logs when your webapp starts that might 
indicate a problem?

--David

aladdin wrote:
> Have we given up here?  Do I need to have the packages in separate jars?
>
> 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 does
>> that automatically per spec.  I'm guessing there is something wrong with
>> 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 jar
>> file.  Then be sure permissions are set so the user tomcat runs as can
>> 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 application.
>>> Although some of my classes have common names, like user.java (compiled,
>>> 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 are
>>> colliding. Loading the app bombs out as tomcat is loading when it can't
>>> find my filter, CheckUser (makes sure users are logged in), which is in
>>> 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 WEB-INF/classes
>>> subdirectory is empty, how do I tell tomcat to go get classes out of the
>>> 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 (in
>>>> 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
>>>> http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.  It
>>>> might offer some ideas.
>>>>
>>>> --David
>>>>
>>>> aladdin wrote:
>>>>         
>>>>> When I put my webapp.jar file in the WEB-INF directory, it doesn't find
>>>>> the app.  When I exploded it into the classes directory, and associated
>>>>> subdirectories, they are found fine, but I get this problem (the one
>>>>> below).
>>>>>
>>>>> This, it turns out, is triggered by the fact I have the webapp.jar file
>>>>> 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 now
>>>>> tomcat won't use that the jar file in the lib directory, even though
>>>>> when it's unpacked in the classes directory, he seems perfectly happy. 
>>>>> 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 persistence not
>>>>>> enabled", or something like that (I don't remember) so I disabled
>>>>>> (commented out) the Manager tag in server.xml that configured the
>>>>>> PersistenceManager. Now, I'm getting
>>>>>>
>>>>>> Feb 16, 2007 9:26:34 PM org.apache.catalina.loader.WebappClassLoader
>>>>>> 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?  I
>>>>>> thought maybe tomcat was restarting, but the PID doesn't change.  It
>>>>>> seems to work, but it's filling up my log files.
>>>>>>
>>>>>>             


---------------------------------------------------------------------
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: Can't find classes in jar files in WEB-INF

Posted by aladdin <al...@csunv.com>.
Have we given up here?  Do I need to have the packages in separate jars?

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 does
> that automatically per spec.  I'm guessing there is something wrong with
> 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 jar
> file.  Then be sure permissions are set so the user tomcat runs as can
> 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 application.
> >Although some of my classes have common names, like user.java (compiled,
> >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 are
> > colliding. Loading the app bombs out as tomcat is loading when it can't
> > find my filter, CheckUser (makes sure users are logged in), which is in
> > 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 WEB-INF/classes
> > subdirectory is empty, how do I tell tomcat to go get classes out of the
> >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 (in
> >>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
> >>http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.  It
> >>might offer some ideas.
> >>
> >>--David
> >>
> >>aladdin wrote:
> >>>When I put my webapp.jar file in the WEB-INF directory, it doesn't find
> >>>the app.  When I exploded it into the classes directory, and associated
> >>>subdirectories, they are found fine, but I get this problem (the one
> >>>below).
> >>>
> >>>This, it turns out, is triggered by the fact I have the webapp.jar file
> >>>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 now
> >>> tomcat won't use that the jar file in the lib directory, even though
> >>> when it's unpacked in the classes directory, he seems perfectly happy. 
> >>> 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 persistence not
> >>>>enabled", or something like that (I don't remember) so I disabled
> >>>>(commented out) the Manager tag in server.xml that configured the
> >>>>PersistenceManager. Now, I'm getting
> >>>>
> >>>>Feb 16, 2007 9:26:34 PM org.apache.catalina.loader.WebappClassLoader
> >>>>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?  I
> >>>>thought maybe tomcat was restarting, but the PID doesn't change.  It
> >>>>seems to work, but it's filling up my log files.
> >>>>
> >>>>TIA
>
> ---------------------------------------------------------------------
> 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

---------------------------------------------------------------------
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: Can't find classes in jar files in WEB-INF

Posted by David Smith <dn...@cornell.edu>.
You don't need to tell tomcat to look in WEB-INF/lib/*.jar.  Tomcat does
that automatically per spec.  I'm guessing there is something wrong with
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 jar
file.  Then be sure permissions are set so the user tomcat runs as can
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 application.  
>Although some of my classes have common names, like user.java (compiled,
>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 are colliding.  
>Loading the app bombs out as tomcat is loading when it can't find my filter,
>CheckUser (makes sure users are logged in), which is in 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 WEB-INF/classes subdirectory 
>is empty, how do I tell tomcat to go get classes out of the 
>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 (in
>>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
>>http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.  It
>>might offer some ideas.
>>
>>--David
>>
>>aladdin wrote:
>>    
>>
>>>When I put my webapp.jar file in the WEB-INF directory, it doesn't find
>>>the app.  When I exploded it into the classes directory, and associated
>>>subdirectories, they are found fine, but I get this problem (the one
>>>below).
>>>
>>>This, it turns out, is triggered by the fact I have the webapp.jar file
>>>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 now tomcat won't
>>>use that the jar file in the lib directory, even though when it's
>>>unpacked in the classes directory, he seems perfectly happy.  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 persistence not
>>>>enabled", or something like that (I don't remember) so I disabled
>>>>(commented out) the Manager tag in server.xml that configured the
>>>>PersistenceManager. Now, I'm getting
>>>>
>>>>Feb 16, 2007 9:26:34 PM org.apache.catalina.loader.WebappClassLoader
>>>>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?  I
>>>>thought maybe tomcat was restarting, but the PID doesn't change.  It
>>>>seems to work, but it's filling up my log files.
>>>>
>>>>TIA
>>>>
>>>>        
>>>>


---------------------------------------------------------------------
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: Can't find classes in jar files in WEB-INF

Posted by Martin Gainty <mg...@hotmail.com>.
can we see your <filter> and <filter-mapping> entries in your web.xml
M-
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "aladdin" <al...@csunv.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Sunday, February 18, 2007 9:46 PM
Subject: Re: Can't find classes in jar files in WEB-INF


> Thanks for the tip!
> 
> I don't think I'd have a conflict with all the classes in my application.  
> Although some of my classes have common names, like user.java (compiled,
> 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 are colliding.  
> Loading the app bombs out as tomcat is loading when it can't find my filter,
> CheckUser (makes sure users are logged in), which is in 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 WEB-INF/classes subdirectory 
> is empty, how do I tell tomcat to go get classes out of the 
> 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 (in
>> 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
>> http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.  It
>> might offer some ideas.
>>
>> --David
>>
>> aladdin wrote:
>> > When I put my webapp.jar file in the WEB-INF directory, it doesn't find
>> > the app.  When I exploded it into the classes directory, and associated
>> > subdirectories, they are found fine, but I get this problem (the one
>> > below).
>> >
>> > This, it turns out, is triggered by the fact I have the webapp.jar file
>> > 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 now tomcat won't
>> > use that the jar file in the lib directory, even though when it's
>> > unpacked in the classes directory, he seems perfectly happy.  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 persistence not
>> >> enabled", or something like that (I don't remember) so I disabled
>> >> (commented out) the Manager tag in server.xml that configured the
>> >> PersistenceManager. Now, I'm getting
>> >>
>> >> Feb 16, 2007 9:26:34 PM org.apache.catalina.loader.WebappClassLoader
>> >> 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?  I
>> >> thought maybe tomcat was restarting, but the PID doesn't change.  It
>> >> seems to work, but it's filling up my log files.
>> >>
>> >> TIA
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>> >
>> > ---------------------------------------------------------------------
>> > 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
>>
>> ---------------------------------------------------------------------
>> 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
> 
> ---------------------------------------------------------------------
> 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: Can't find classes in jar files in WEB-INF

Posted by aladdin <al...@csunv.com>.
Thanks for the tip!

I don't think I'd have a conflict with all the classes in my application.  
Although some of my classes have common names, like user.java (compiled,
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 are colliding.  
Loading the app bombs out as tomcat is loading when it can't find my filter,
CheckUser (makes sure users are logged in), which is in 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 WEB-INF/classes subdirectory 
is empty, how do I tell tomcat to go get classes out of the 
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 (in
> 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
> http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.  It
> might offer some ideas.
>
> --David
>
> aladdin wrote:
> > When I put my webapp.jar file in the WEB-INF directory, it doesn't find
> > the app.  When I exploded it into the classes directory, and associated
> > subdirectories, they are found fine, but I get this problem (the one
> > below).
> >
> > This, it turns out, is triggered by the fact I have the webapp.jar file
> > 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 now tomcat won't
> > use that the jar file in the lib directory, even though when it's
> > unpacked in the classes directory, he seems perfectly happy.  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 persistence not
> >> enabled", or something like that (I don't remember) so I disabled
> >> (commented out) the Manager tag in server.xml that configured the
> >> PersistenceManager. Now, I'm getting
> >>
> >> Feb 16, 2007 9:26:34 PM org.apache.catalina.loader.WebappClassLoader
> >> 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?  I
> >> thought maybe tomcat was restarting, but the PID doesn't change.  It
> >> seems to work, but it's filling up my log files.
> >>
> >> TIA
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> > ---------------------------------------------------------------------
> > 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
>
> ---------------------------------------------------------------------
> 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

---------------------------------------------------------------------
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: Can't find classes in jar files in WEB-INF

Posted by David Smith <dn...@cornell.edu>.
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 (in 
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 
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.  It 
might offer some ideas.

--David

aladdin wrote:
> When I put my webapp.jar file in the WEB-INF directory, it doesn't find the 
> app.  When I exploded it into the classes directory, and associated 
> subdirectories, they are found fine, but I get this problem (the one below).
>
> This, it turns out, is triggered by the fact I have the webapp.jar file 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 now tomcat won't use that the jar 
> file in the lib directory, even though when it's unpacked in the classes 
> directory, he seems perfectly happy.  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 persistence not
>> enabled", or something like that (I don't remember) so I disabled
>> (commented out) the Manager tag in server.xml that configured the
>> PersistenceManager. Now, I'm getting
>>
>> Feb 16, 2007 9:26:34 PM org.apache.catalina.loader.WebappClassLoader
>> 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?  I
>> thought maybe tomcat was restarting, but the PID doesn't change.  It seems
>> to work, but it's filling up my log files.
>>
>> TIA
>>
>> ---------------------------------------------------------------------
>> 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
>>     
>
> ---------------------------------------------------------------------
> 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
>
>   


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