This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Tomcat and the fly likes useBean error & classpath setting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "useBean error & classpath setting" Watch "useBean error & classpath setting" New topic

useBean error & classpath setting

shivani anand
Ranch Hand

Joined: Dec 28, 2000
Posts: 155
I started tomcat through following script

echo Starting Tomcat > tomcat_status
date >> tomcat_status
export JAVA_HOME
rm nohup.out
nohup ./ &

now I am tring to access one jsp script from explorer

It is giving me following error..
org.apache.jasper.JasperException: /cu/emailreg/process_request.jsp(3,0) The value for the useBean class attribute cu.emailreg.RegistrantBean is invalid.

Why it is giving so any idea?

there is a file RegistrantBean.class in following folder


Please advice.
Tim Baker
Ranch Hand

Joined: Oct 04, 2003
Posts: 541
Lets see the useBean statement in your JSP
and also
Lets see the top of your java file ie all the code in the top until the end of your default constructor.

Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
shivani anand
Ranch Hand

Joined: Dec 28, 2000
Posts: 155
I am sending code but the thing is it is working on one box I am trying to migrate all application on different server.

************* process_request.jsp ****************
<%@ page import="java.util.*" %>

<jsp:useBean id="xxxxxx" class="cu.emailreg.RegistrantBean" scope="request">
<jsp:setProperty name="Registrant" property="*"/>
if (Registrant.validate()) {
} else {
// invalid data - display error page
<jsp:forward page="get_info.jsp"/>

**************************java code *************
package cu.emailreg;

import coreservlets.DBResults;
import coreservlets.DatabaseUtilities;
import csc.utils.StringFormat;
import csc.utils.errorHandler;
import java.util.Hashtable;

// Referenced classes of package cu.emailreg:
// emailSubscriberConnectionPool

public class RegistrantBean

public RegistrantBean()
version = "1.1, 2003/12/23";
debug = false;
System.out.println(getClass().getName() + " version " + version + ": entering RegistrantBean method");
email = "";
fname = "";
action = "";
list = new String[0];
redirect = "";
crsubscriber = "";
availableList = new Hashtable();
general_error_msg = "";
errors = new Hashtable();
System.out.println(getClass().getName() + ": leaving RegistrantBean method");
shivani anand
Ranch Hand

Joined: Dec 28, 2000
Posts: 155
One more thing my process_request.jsp in following folder

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

First, Tomcat does not use your classpath. It finds classes by searching a predefined set of directories.

Where did you put your RegistrantBean class?

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Tim Baker
Ranch Hand

Joined: Oct 04, 2003
Posts: 541
so you said your class is in:

but your jsp is in:

I believe your class should be in:
shivani anand
Ranch Hand

Joined: Dec 28, 2000
Posts: 155

Thanks a bunch it worked
I agree. Here's the link:
subject: useBean error & classpath setting
It's not a secret anymore!