• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Bean class not found error...

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Tomcat 4.0 on windows 98, when I try to use my bean class from jsp program, I get class not found error. I read/followed all the similar problems in the forum but still have not been able to solve the problem.
The error I get is as follows:
==============================
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.

An error occurred at line: 1 in the jsp file: /handoff1.jsp
Generated servlet error:
D:\Apps\Apache\Tomcat4.0\work\Standalone\localhost\cartapp\handoff1$jsp.java:56: Class com.cartapp.user.User not found.
com.cartapp.user.User handoff = null;
^
An error occurred at line: 1 in the jsp file: /handoff1.jsp
Generated servlet error:
D:\Apps\Apache\Tomcat4.0\work\Standalone\localhost\cartapp\handoff1$jsp.java:59: Class com.cartapp.user.User not found.
handoff= (com.cartapp.user.User)
^

An error occurred at line: 1 in the jsp file: /handoff1.jsp
Generated servlet error:
D:\Apps\Apache\Tomcat4.0\work\Standalone\localhost\cartapp\handoff1$jsp.java:64: Class com.cartapp.user.User not found.
handoff = (com.cartapp.user.User) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.cartapp.user.User");
^
3 errors, 1 warning
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
=============================================

Location of files
==================
My jsp file is located at:
D:\Apps\Apache\Tomcat4.0\webapps\ROOT\cartapp
my bean class - User - is at:
D:\Apps\Apache\Tomcat4.0\webapps\ROOT\WEB-INF\classes\com\cartapp\user
Contents of the jsp file
=======================
<jsp:useBean id="handoff" scope="session" class="com.cartapp.user.User" />
<HTML>
<BODY>
This is the setting page!
<%
handoff.setFirstName("George");
%>
</BODY>
</HTML>
The first 2 lines of the class are:
==================================
package com.cartapp.user;
public class User {

Environment settings
====================
JAVA_HOME=D:\Apps\java\jdk
CATALINA_HOME=D:\Apps\Apache\Tomcat4.0
CLASSPATH=;.;F:\ola\progmn\JAVA\pkgs;D:\Apps\Apache\Tomcat4.0\common\lib\servlet.jar
Can anyone please help. Thanks.

Thanks.
Ola Oke (SCJP 1.4)
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your JSP have a <%@ page tag that imports the "com.cartapp.user" package?
Bill
 
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic