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 Error on JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error on JSP" Watch "Error on JSP" New topic
Author

Error on JSP

Nupur Khanna
Greenhorn

Joined: May 18, 2006
Posts: 4
When I run my JSP I encounter the following error. What could be the probable cause of this error?

javax.servlet.ServletException: Exception creating bean of class com.patni.peass.maintaincategory.AddCategoryForm: {1}
Soumya Saha
Ranch Hand

Joined: Apr 14, 2006
Posts: 64
Hi Nupur,
Check ur Struts-Config Entry.

Thnaks
Vani Bandargal
Ranch Hand

Joined: Oct 06, 2005
Posts: 82
From the following link
http://www.geocities.com/Colosseum/Field/7217/SW/struts/errors.html

Probable Causes Instantiating Struts-provided ActionForm class directly instead of instantiating a class derived off ActionForm. This might occur implicitly if you specify that a form-bean is this Struts ActionForm class rather than specifying a child of this class for the form-bean.
Not associating an ActionForm-descended class with an action can also lead to this error.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
9 times out of 10 when this error occurs, it's because of a typo. Carefully check that the fully qualified class name in your <form-bean> tag in struts-confix.xml is spelled correctly and with the correct case.


Merrill
Consultant, Sima Solutions
Anu Gupta
Greenhorn

Joined: May 26, 2006
Posts: 3
Hello Guys,

I am facing this strange problem in my Login.jsp page. Whenevr I type

<html:text property="username" size="16" "/>. The jsp is giving an error.

However if I type something else inplace of the above, there is no error.

Validation gramework is also not working. Please give your views. anything is welcome

I am posting the code for Login.jsp and the error.

Please help me I am stuck in this code since last 1 week.

Regards,

anurag

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>


<html>

<head>

<title><bean:message key="title.login"/></title>
<html:base/>

</head>

<body>

<html:form action="/login"

name="LoginForm"
type="org.apache.struts.validator.DynaValidatorForm"
onsubmit="return validateLoginForm(this);">

<table border="0" width="100%">

<tr>
<th align="right">
<bean:message key="label.username"/>

</th>

<td align="left">

</td>

</tr>

<tr>
<th align="right">
<bean:message key="label.password"/>
</th>

<html:text property="username" size="16"/>


<td align="left">
<html assword property="password" size="16" redisplay="false"/>
</td>
</tr>

<tr>
<td align="right">
<html:submit value="Login"/>
</td>
<td align="left">
<html:reset/>
</td>
</tr>

</table>

</html:form>


</body>

</html>



org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:346)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


??

java.lang.NullPointerException
org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1109)
org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:952)
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176)
org.apache.jsp.Login_jsp._jspx_meth_html_text_0(Login_jsp.java:269)
org.apache.jsp.Login_jsp._jspx_meth_html_form_0(Login_jsp.java:189)
org.apache.jsp.Login_jsp._jspService(Login_jsp.java:97)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
[ May 26, 2006: Message edited by: Anu Gupta ]
Sachin Kediyal
Greenhorn

Joined: May 11, 2006
Posts: 9
You have not properly mapped your ActionForm class in the struts-config.xml.Check the <form-bean> and <action-mapping> in the struts-config.xml. Also check that each and every field property name in the JSP has a setter() and getter() method define in the ActionForm class.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error on JSP