You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Woodchuck <wo...@yahoo.com> on 2005/05/16 16:33:49 UTC
tc 5.5.9 webapp jars not loading
hihi all,
i've read the class loader how-to and also searched the archives but
haven't found any answers for my current problem -- which is that my
application-specific jars (under WEB-INF/lib) don't seem to get loaded
at all.
for instance, i have ojdbc14.jar (Oracle JDBC API) under WEB-INF/lib
but i get ClassDefNotFoundExceptions when my app is trying to establish
its connection pool.
but when i place the ojdbc14.jar under common/lib my app can establish
the connection pool.
there are other jars in my WEB-INF/lib like common-beanutils.jar and
such that are also not being loaded (i get same run-time errors when
accessing jsps in my app).
does anyone have any suggestion as to why my WEB-INF/lib folder seems
to be ignored?
the jars in WEB-INF/lib got loaded fine in Tomcat 4.1.29 and i'm in the
process of upgrading it to Tomcat 5.5.9.
thanks in advance,
woodchuck
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: tc 5.5.9 webapp jars not loading
Posted by Lutz Zetzsche <Lu...@sea-rescue.de>.
Hi,
Am Montag, 16. Mai 2005 16:33 schrieb Woodchuck:
> i've read the class loader how-to and also searched the archives but
> haven't found any answers for my current problem -- which is that my
> application-specific jars (under WEB-INF/lib) don't seem to get
> loaded at all.
>
> for instance, i have ojdbc14.jar (Oracle JDBC API) under WEB-INF/lib
> but i get ClassDefNotFoundExceptions when my app is trying to
> establish its connection pool.
>
> but when i place the ojdbc14.jar under common/lib my app can
> establish the connection pool.
>
> there are other jars in my WEB-INF/lib like common-beanutils.jar and
> such that are also not being loaded (i get same run-time errors when
> accessing jsps in my app).
>
> does anyone have any suggestion as to why my WEB-INF/lib folder seems
> to be ignored?
>
> the jars in WEB-INF/lib got loaded fine in Tomcat 4.1.29 and i'm in
> the process of upgrading it to Tomcat 5.5.9.
It seems that you missed someting when reading the class loader how-to.
The how-to says:
(1) "Common - This class loader contains additional classes that are
made visible to both Tomcat internal classes and to all web
applications."
(2) "Shared - This class loader is the place to put classes and
resources that you wish to share across ALL web applications (unless
Tomcat internal classes also need access, in which case you should put
them in the Common class loader instead)."
(3) "WebappX - [...] All unpacked classes and resources in
the /WEB-INF/classes directory of your web application archive, plus
classes and resources in JAR files under the /WEB-INF/lib directory of
your web application archive, are made visible to the containing web
application, but to no others."
So, the difference between (1) and (2) plus (3) is that the Tomcat
internal classes have access to the files in the common directory but
not to the classes in shared or /WEB-INF/classes or /WEB-INF/lib.
I.e. your ojdbc14.jar must be visible to Tomcat internal classes.
Therefore it must be stored in the common directory.
Best wisjes
Lutz
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org