I'm pretty certain that my war file is set up correctly.  In my
WEB-INF/lib directoy I have jdbc jar file that tomcat can't find and the
tomcat user manual for deploying tomcat applications says 


    WEB-INF/lib/ - This directory contains JAR files that contain Java
    class files (and associated resources) required for your
    application, such as third party class libraries or JDBC drivers.



My servlets are in the WEB-INF/classes directory and the same document
says


    WEB-INF/classes/ - This directory contains any Java class files (and
    associated resources) required for your application, including both
    servlet and non-servlet classes, that are not combined into JAR
    files.



Aside from that I have read the Servlet 2.3 spec on this topic and it
says this about the WEB-INF/lib


    The /WEB-INF/lib/*.jar area for Java ARchive files. These files
    contain servlets, beans, and other utility classes useful to the web
    application. The web application class loader can load class from
    any of these archive files.

Here is what it says about the WEB-INF/classes directory

    The /WEB-INF/classes/* directory for servlet and utility classes.
    The classes in this directory are available to the application class
    loader.


Now to re-cap I have a jdbc jar file in WEB-INF/lib and I'm trying to
access it from a servlet in WEB-INF/classes

    After looking at the spec again it says the container "can load
    classes from any of these archive files".  I suppose this could mean
    that it is optional for the container to load the classes found in
    this directory, in which case tomcat is adhearing to the spec and it
    is not required to load all the classes it finds there.



If you see something that I'm mis-interpting please let me know.

thanks

joe





On 25 Jul 2001 11:39:11 -0700, Craig R. McClanahan wrote:
> 
> 
> On Wed, 25 Jul 2001 [EMAIL PROTECTED] wrote:
> 
> > 
> > This is my workaround as well, but it is not a very good solution. I often
> > have multiple webapps running that need different versions of the same jar
> > file. This becomes a real pain.
> > Thanks,
> > Dave
> > 
> 
> If you have to modify the CLASSPATH to make classes inside JAR file in a
> /WEB-INF/lib directory available, your webapps are set up incorrectly.  
> In fact, doing this will make a lot of other things (like automatic
> reloading on updated classes) fail miserably.
> 
> One good source of information about how to organize your web applications
> is the "Application Developer's Guide" that is shipped with Tomcat (both
> 3.2 and 4.0).  Additionally, you should consider the Servlet Specification
> (version 2.2 or 2.3, depending on which Tomcat you're running) to be
> ***required reading***, because that's where the requirements for web
> applications are actually defined.  You can get the spec from:
> 
>   http://java.sun.com/products/servlet/download.html
> 
> Craig McClanahan
> 



-- 
##############################
# Joseph Toussaint           #
# Caribou Lake Software      #
# http://www.cariboulake.com #
# [EMAIL PROTECTED]   #
# 952-837-98029              #
##############################

Reply via email to