File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Exception creating bean of class sample.LookSymbol Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Exception creating bean of class sample.LookSymbol" Watch "Exception creating bean of class sample.LookSymbol" New topic
Author

Exception creating bean of class sample.LookSymbol

Vinayak kk
Greenhorn

Joined: Oct 27, 2005
Posts: 3
Hi friends,

I am new to Struts. I have created an application.
But it is throwing the exception as:
org.apache.jasper.JasperException: Exception creating bean of class sample.LookSymbolForm: java.lang.ClassNotFoundException: sample.LookSymbolForm

I have checked everything, but not able to locate the error. can any body help me out.

Jsp Page:
<html:html>
<html:form action="lookSymbol.do"
name="LookSymbolForm" type="sample.LookSymbolForm">
<table width="100%">
<tr>
<td>Vinayak's first Struts Project.</td>
</tr>
</table>
<table width="100%">
<tr>
<td>Symbol:<html:text property="symbol" /></td>
</tr>
<tr>
<td><html:submit value="Submit Symbol" /></td>
</tr>
</table>
</html:form>
</html:html>

LookSymbolForm.java::
package sample;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
* Type the Comments.
*
*/
public class LookSymbolForm extends ActionForm {

/**
* Declarations of Variables.
*/
private String symbol;

/**
* @return Returns the symbol.
*/
public String getSymbol() {
return symbol;
}
/**
* @param symbol The symbol to set.
*/
public void setSymbol(String symbol) {
this.symbol = symbol;
}

public void reset(ActionMapping mapping, HttpServletRequest req) {
this.symbol = null;
}
}
struts-config.xml::
<form-beans>
<form-bean name="LookSymbolForm" type="sample.LookSymbolForm"/>
</form-beans>
<action-mappings>
<action input="/pages/start.jsp" name="LookSymbolForm" scope="session" path="/lookSymbol" type="sample.LookSymbolAction">
<forward name="SUCCESS" path="/pages/view.jsp"/>
<forward name="FAILURE" path="/pages/start.jsp"/>
</action>
</action-mappings>

So, please help me.
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
When did you get this exception? Some advices (not sure if they help): (1) in <html:form> name & type attribute are deprecated; (2) in <action> usually if I specify input= I would add validate="true"
Vinayak kk
Greenhorn

Joined: Oct 27, 2005
Posts: 3
hello Alec,

I am getting this exception when i m submitting the jsp page.
I will check with the things what you have suggested.
Thanks in advance
Vinayak
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Exception creating bean of class sample.LookSymbol