Greetings,

For the past few-several days I have been scouring the internet and this
list extensively to no avail.  First I'll describe the error and then give
as much detail as possible about the structure of our web-app project as
possible.  Before I came to work on this project, it was running fine on a
tomcat 4.1 server by simply having all class files in a single jar file,
however it wasn't being managed very well and was being developed in Windows
even though our deployment was to be in Red Hat, so I decided to get the
project into Netbeans under a Red Hat VM with tomcat 5.5 and after a day had
it compiling and reporting no errors (there were plenty of errors when first
imported into netbeans).  But ever since then, its always been the same
problem with tomcat not being able to detect the class necessary for loading
the GUI.

After proper authentication with a db2 database, our servlets call up an
html page with an embedded applet in a new window (we've even tried loading
in the same window).  This applet has given me a ClassNotFoundException in
every instance I have tried.  I am using Netbeans 5.0 and it correctly
places all class files in the classes directory under WEB-INF with correct
package directory appearance and all jar library files in the lib
directory.  All of our program's custom classes now belong to a single
package, including the servlets (originally all custome classes had no
package), 3rd party classes are in their appopriate packages as well (they
are now in jars in the lib dir), and the whole thing compiles without any
errors.  The tomcat servers also starts without any errors, and both the
standalone and bundled Netbeans tomcats always give this same error in every
instance as well.  The Netbeans output tab shows that the user is being
appropriately authenticated after logging in and checking against the
database within our servlet (which also uses other classes within our
package).  After attempting the load the applet the only thing in netbeans
which indicates a problem has occurred is upon inspection of the HTTP
requests, which shows that two requests failed:
/ONLINEBOM/olb/HomeMenu.class and /ONLINEBOM/olb/HomeMenu/class.class.  The
former seems like it should be correct, since I assume netbeans
automatically sets correct classpaths and such. The latter is an inexistant
file whose lookup doesn't really seem to affect this particular problem.

the standard structure of the files is as follows:
-the olb package is in WEB-INF/classes/olb/*.class
-all 3rd party libraries are in WEB-INF/lib/*.jar
-the web.xml file with the servlet declaration stuff is in WEB-INF
-html files are in the root directory of the project

the html file which calls the applet contains the following in its body:
<applet CODEBASE="olb" CODE="HomeMenu.class" WIDTH="400"
HEIGHT="280"></applet>
I have also tried not using codebase and placing in CODE both "
olb.HomeMenu.class" and "olb/HomeMenu.class".  I have also tried using the
ARCHIVE options when trying this and other attempts described below.


I have tried the following besides the standard for placement of
classes/packages:
-placing all classes in a single jar file (in lib, classes, or even in the
root folder for the webapp where the html is)
-placing our classes in one jar, 3rd party classes in 2 other jars (in lib,
classes, etc.)
-placing all classes in the directory structure without the use of jars (in
classes directory and lib)
-placing all classes/jars in the shared/classes and shared/lib tomcat
directories (when attempted with the standalone tomcat server)


Is this just a simple CLASSPATH problem? I assumed it wasn't from reading
that tomcat sets its own classpath anyway.  Is it entirely the fault of the
servlet?  Is there some other configuration settings I'm entirely missing
here?  I would really, completely, and utterly appreciate some help which
could get this poor web-app back on its feet and ready for continued
development.

Thanks!

Eric Harbeston

Reply via email to