You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Will England <wi...@mylanders.com> on 2001/07/18 19:53:41 UTC

JSP's not finding classes in WEB-INF

Greetings!

Ok - running Tomcat 3.2 on SunOS 2.7, with Java 1.2.  

I have a working application with servlets and JSP pages running under
Tomcat 3.1.  I'm trying to port it to 3.2.

However, every time I hit a JSP page, it gives a 500 error about how it
cannot find classes to compile.  Those classes are located in the WEB-INF
directory, under the /classes folder.  

The classpath does *not* contain the WEB-INF/classes directory.

If I hard-code the WEB-INF/classes directory into the classpath, they
work.  However, I do not want to do this.  

What is the problem, and how can I resolve it?

I have tried settiing the environment variables TOMCAT_HOME and JAVA_HOME,
and moving tools.jar into TOMCAT_HOME/lib.

Thanks for any tips or pointers!

Will


-- 
  /~>'find `funny quote`': Command not found; humor not installed.  
  1986 Concours 72,xxx  1982 Maxim 12,xxx (For Sale!) CDA #00046
  Overland Park, KS     will@mylanders.com     PCS: 316-371-FOAD
                    http://will.mylanders.com/



Re: JSP's not finding classes in WEB-INF

Posted by Will England <wi...@mylanders.com>.
On Wed, 18 Jul 2001, Aditya Anand wrote:

> this seems stupid but did u restart the server!...
> also you do have the servlets defined in
> web.xml..right?
> 

Yes, I restared the server.  <grin>

> My servlets and Beans are in separate jar files under
> WEB-INF/lib, which also contains other jars need,
> Ihave never touched the classpath setup by Tomcat, and
> it orks just fine....

Look at your classpath as echoed by the tomcat script - most likely you
have pointers in there to the servlets and beans directories.  The tomcat
script adds your environment classpath to the end of the classpath it
dynamically generates.  

I've taken that part of the script out, so that the only things in the
classpath are the jar files in TOMCAT_HOME/lib.


> Can I have a peek at the logs?

No logs, just the errors.  If you want the whole error text I can send it
to you.  Won't be very helpful, tho, all it boils down to is "I can't find
your classes!"

Will




Re: JSP's not finding classes in WEB-INF

Posted by Aditya Anand <ad...@yahoo.com>.
this seems stupid but did u restart the server!...
also you do have the servlets defined in
web.xml..right?

I use 4.0 b-5, and I haven't come across this problem,

My servlets and Beans are in separate jar files under
WEB-INF/lib, which also contains other jars need,
Ihave never touched the classpath setup by Tomcat, and
it orks just fine....

Can I have a peek at the logs?


--- Will England <wi...@mylanders.com> wrote:
> On Wed, 18 Jul 2001, Aditya Anand wrote:
> 
> > > However, every time I hit a JSP page, it gives a
> 500
> > > error about how it
> > > cannot find classes to compile.  Those classes
> are
> > > located in the WEB-INF
> > > directory, under the /classes folder.  
> > 
> > I assume these are your bean classes. These should
> be
> > put under the WEB-INF/lib directory rather than
> the
> > classes directory. The classes directory is ment
> only
> > for un-jarred servlet classes that have been
> declared
> > in the web.xml file.
> 
> Actually, just to make things interesting, those
> *are* servlet
> classes.  We have both servlets and JSP's that use
> library classes for
> various things.  Currently, they live in
> WEB-INF/classes.  One of these
> years we'll get things sorted out a bit better.
> 
> > Put any servlet jars, beans, and required
> > non-statndard libraries under the lib folder (like
> > log4J, or xalan)
> 
> Ok, so I created a jar file with the servlet classes
> and library classes
> in it and moved it to WEB-INF/lib.
> 
> Didn't work.
> 
> I cannot put this .jar file in TOMCAT_HOME/lib --
> each context / virtual
> host will have slightly different bits in the
> servlets.
> 
> Will
> 


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Re: JSP's not finding classes in WEB-INF

Posted by Will England <wi...@mylanders.com>.
On Wed, 18 Jul 2001, Aditya Anand wrote:

> > However, every time I hit a JSP page, it gives a 500
> > error about how it
> > cannot find classes to compile.  Those classes are
> > located in the WEB-INF
> > directory, under the /classes folder.  
> 
> I assume these are your bean classes. These should be
> put under the WEB-INF/lib directory rather than the
> classes directory. The classes directory is ment only
> for un-jarred servlet classes that have been declared
> in the web.xml file.

Actually, just to make things interesting, those *are* servlet
classes.  We have both servlets and JSP's that use library classes for
various things.  Currently, they live in WEB-INF/classes.  One of these
years we'll get things sorted out a bit better.

> Put any servlet jars, beans, and required
> non-statndard libraries under the lib folder (like
> log4J, or xalan)

Ok, so I created a jar file with the servlet classes and library classes
in it and moved it to WEB-INF/lib.

Didn't work.

I cannot put this .jar file in TOMCAT_HOME/lib -- each context / virtual
host will have slightly different bits in the servlets.

Will


Re: JSP's not finding classes in WEB-INF

Posted by Aditya Anand <ad...@yahoo.com>.
> Greetings!
> 
> Ok - running Tomcat 3.2 on SunOS 2.7, with Java 1.2.
>  
> 
> I have a working application with servlets and JSP
> pages running under
> Tomcat 3.1.  I'm trying to port it to 3.2.
> 
> However, every time I hit a JSP page, it gives a 500
> error about how it
> cannot find classes to compile.  Those classes are
> located in the WEB-INF
> directory, under the /classes folder.  

I assume these are your bean classes. These should be
put under the WEB-INF/lib directory rather than the
classes directory. The classes directory is ment only
for un-jarred servlet classes that have been declared
in the web.xml file.

> The classpath does *not* contain the WEB-INF/classes
> directory.
you donot have to specify WEB-INF/classes in the
system classpath
 
> If I hard-code the WEB-INF/classes directory into
> the classpath, they
> work.  However, I do not want to do this.  
> 
> What is the problem, and how can I resolve it?
> 
> I have tried settiing the environment variables
> TOMCAT_HOME and JAVA_HOME,
> and moving tools.jar into TOMCAT_HOME/lib.
Put any servlet jars, beans, and required
non-statndard libraries under the lib folder (like
log4J, or xalan)

cheers
Adi


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/