• 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

Error on JSP

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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}
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nupur,
Check ur Struts-Config Entry.

Thnaks
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic