You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Scott Tatum <sc...@wcom.com> on 2001/03/07 16:49:54 UTC

Strange custom class behaviour with subdirs in 3.2.1

First, the obligatory setup info:

Tomcat 3.2.1 using built-in webserver changed to port 80.
RedHat 6.2
Sun JDK 1.3.0_02

I'm having a strange problem that I did not have while using JRun, and
I'm hoping someone can shed some light.

The situation is simple - say I have a webapp called blah. In blah's
WEB-INF/lib directory I have a jar file with some classes that I use
frequently. One of these classes is StatsBean. Then I have all my jsp
files in the docBase and I can use the StatsBean fine.

I also have a helpdesk directory off of the docBase (i.e.
webapps/blah/helpdesk) which also needs to use the StatsBean. If I have
a jsp file in the helpdesk directory that tries to declare/use a
StatsBean, or any of my custom classes, I get this kind of error:

(this example is a webapp called ct-dev whose context path is / and is
compiling /helpdesk/helpdesk.jsp)

org.apache.jasper.JasperException: Unable to compile class for
JSP/usr/tomcat/work/xxx.xxx.xxx.xxx_8080/_0002fhelpdesk_0002fhelpdesk_0002ejsphelpdesk_jsp_0.java:73:

Class helpdesk.StatsBean not found.
                 StatsBean statsBean = (StatsBean)
session.getAttribute("statsBean");

For some reason it thinks all my classes should be in a helpdesk package
because the URI has helpdesk in it. Is this expected behaviour? I did
not have this problem in JRun. I would expect to be able to use my
classes anywhere in the web application, not just the app root. The
problem manifests itself both with classes in the WEB-INF/classes dir,
and classes in jars in the WEB-INF/lib dir.

I'm certainly not counting out a configuration problem. If I need to
post the contents of my configuration files I can. Of course, I don't
really even know what all configuration files are used! As far as I can
tell, the standalone tomcat only needs server.xml and web.xml. A lot of
them seem to be only for mod_jk and/or mod_jserv. It's hard to tell from
looking at the mass of config files in the conf directory what is needed
by tomcat standalone, tomcat+apache, etc. It would be nice to have a
document that explains every file in the conf directory and what it is
needed for. That way I could do some cleanup and know that the files I
have in there all have something to do with my setup. I have this
feeling that several of them are jserv (i.e. not mod_jk) related and
could be removed in most situations. Now watch someone point me to just
such a file that probably comes with Tomcat. 8-)

-Scott

--
Scott Tatum | scott.tatum@wcom.com
Senior Applications Developer, Special Projects
WorldCom | http://www.wcom.com/