Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes Exception creating bean of class... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Exception creating bean of class..." Watch "Exception creating bean of class..." New topic

Exception creating bean of class...


Joined: Jan 19, 2006
Posts: 2
New here. Just read through posts concerning Exceptions creating bean of class and couldn't find my answer.

I'm using a book, which is outdated but I didn't realize it. However, I thought I'd try to get through it anyways.

The exception is as follows:

javax.servlet.ServletException: Exception creating bean of class LookupForm: java.lang.ClassNotFoundException: LookupForm
at org.apache.jasper.runtime.PageContextImpl.handlePageException(
at org.apache.jsp.index_jsp._jspService(
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(

I am using Tomcat 4.1.31 and j2sdk1.4.2.

The struts-config.xml file:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"


<form-bean name="lookupForm"

<forward name="success" path="/quote.jsp"/>
<forward name="failure" path="/index.jsp"/>


The file:

package ch3;

import javax.servlet.http.*;
import org.apache.struts.action.*;

public class LookupForm extends ActionForm
private String symbol = null;

public String getSymbol()
return symbol;

public void setSymbol(String symbol)
this.symbol = symbol;

public void reset(ActionMapping mapping,
HttpServletRequest request)
this.symbol = null;

The index.jsp file:

<%@ page language="java" %>
<%@ include file="/WEB-INF/jsp/TagLibraryHeader.jsp" %>

<title>Wrox Struts Application</title>

<table width="500" border="0" cellspacing="0" cellpadding="0">
<td> </td>
<td height="68" width="48%">
<div align="left">
<img src="images/newwroxlogo.gif"
<td> </td>
<td> </td>

<html:form action="Lookup">
<table width="45%" border="0">
<td><html:text property="symbol" /></td>
<td colspan="2" align="center"><html:submit /></td>

The original error I had the errors with the attributes for the <html:form> tag. I removed the attributes in the index.jsp file to be:

<html:form action="Lookup">

This solved one issue, however I get the following exception now. The LookupAction and LookupForm were both compiled and placed into the


Any help would be appreciated. Thanks!

Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
The problem may be that you are missing a required library. ClassNotFoundException is definitely the least informative error that the JDK ever throws. Sometimes it means the class wasn't found. Sometimes it just means that loading failed because your class needed another class, and the second class was the one that wasn't found.

Reid - SCJP2 (April 2002)
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
One thing I can discern from the message is that the class that can't be found is "LookupForm", which means that it doesn't realize that LookupForm is in the package ch3. Otherwise, it would say it couldn't find "ch3.LookupForm".

Since you define your form bean as type="ch3.LookupForm", though, I don't see why it's not picking up the correct class name.

The only thing I can think of to tell you is to re-deploy the application and re-start the application server. Maybe there's an old copy of struts-config.xml that's getting used instead of the one you showed us.
[ January 19, 2006: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
I agree. Here's the link:
subject: Exception creating bean of class...
It's not a secret anymore!