tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guus Holshuijsen" <guus.holshuij...@videtur.nl>
Subject ClassNotFoundException
Date Tue, 17 Jun 2003 10:42:55 GMT
Hi!

I am stuck with the following "challenge".

After some initial problems with my web application with regard to ClassNotFoundExceptions
when trying to read blobs from a MySQL database which was caused by my lack of knowledge regarding
the Tomcat class loading filosophy (which is explained very well in http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html)
I am stuck with the following:

I started out with a web application that was fully selfcontained i.e. it
did not use database or JNDI resources defined in the Tomcat container. So
there was a mysql-connector-java.jar in the WEB-INF/lib of the web
application and the classes were in WEB-INF/classes. While developing under
Forte4J (SunONE Studio update 1, Tomcat v4.0.1, NetBeans, Windows2000)
everything seemed to work fine. Then I deployed to a RedHat Linux 8.0 host
running Tomcat v4.0.3 and I got the ClassNotFoundException.

QUESTION:
Can somebody explain - in terms of class loading - why I get
the ClassNotFoundException when both the MySQL driver stuff and the web
application are in the same class loader context (at least they are there
from my point of view).

Then I changed to running Tomcat v4.1.24 both on W2000 and RH 8.0 (with JDK
1.4.0_01), I redesigned my web application to use the Tomcat filosophy regarding JNDI and
database resources and I still got the ClassNotFoundException, that is until I found the documentation
about class loading...

What I don't like much is that I have to move part of my web application code (the classes
that are stored as blob in the database) into the container's common/lib directory. This causes
deployment of my web application to be more difficult and makes my web application less portable.

Of course I did NOT read all of the Tomcat documentation, so I will not say that I know all
about the different ways to configure a web application in Tomcat, but sometimes a few words
in the right direction helps me to focus.

I'm off reading more of the Tomcat docs and hope for somebody out there to enlighten me ;-)


Regards,
Guus


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message