Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception creating bean of class (in struts apllication)

 
Rajendra Nath
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

I'm implementing an application in struts, and I'm getting the following exception.

org.apache.jasper.JasperException: Exception in JSP: /pages/jsp/customerinfo.jsp:172

169: </head>
170: <body>
171:
172: <html:form action="/information" onsubmit="return validation();">
173: <table class="inner" width="770">
174: <tr>
175: <td>


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause

javax.servlet.ServletException: Exception creating bean of class com.form.SubmitForm: {1}
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.pages.jsp.customerinfo_jsp._jspService(customerinfo_jsp.java:254)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause

javax.servlet.jsp.JspException: Exception creating bean of class com.form.SubmitForm: {1}
org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:563)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:520)
org.apache.jsp.pages.jsp.customerinfo_jsp._jspx_meth_html_form_0(customerinfo_jsp.java:271)
org.apache.jsp.pages.jsp.customerinfo_jsp._jspService(customerinfo_jsp.java:244)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

--------------------------------------------------------------------------------------
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"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<data-sources>

</data-sources>

<form-beans>
<form-bean name="submitForm" type="com.form.SubmitForm" />
<form-bean name="loginForm" type="com.form.LoginForm" />
</form-beans>

<global-exceptions/>

<global-forwards>
<forward name="error" path="/pages/jsp/error.jsp" />
</global-forwards>

<action-mappings>

<action path="/information"
scope="request"
name="submitForm"
type="com.action.SubmitAction">
<forward name="success" path="/pages/jsp/customerinfo.jsp"/>
</action>

<action path="/login"
scope="request"
name="loginForm"
type="com.action.LoginAction">
<forward name="success" path="/pages/jsp/login.jsp"/>
</action>

</action-mappings>



<controller/>
<!-- ========== Message Resources Definitions ============================ -->
<message-resources
factory="org.apache.struts.util.PropertyMessageResourcesFactory"
key="org.apache.struts.action.MESSAGE"
null="true"
parameter="com.mass.drm.app.ApplicationResources"/>

</struts-config>

-------------------------------------------------------------------------
PART of jsp page

<body>
<html:form action="/information" onsubmit="return validation();">
<table class="inner" width="770">
<tr>
<td>
<h2 align="center"> Individual Information </h2>
</td>
</tr>
</table>
----------------------------------------------------------------------------

WEB.XML

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

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
<taglib>
<taglib-uri>struts-logic</taglib-uri>
<taglib-location>
pages/tld/struts-logic.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>struts-form</taglib-uri>
<taglib-location>
pages/tld/struts-form.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>struts-bean</taglib-uri>
<taglib-location>
pages/tld/struts-bean.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>struts-html</taglib-uri>
<taglib-location>
pages/tld/struts-html.tld
</taglib-location>
</taglib>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>

<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>

<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>

<init-param>
<param-name>nocache</param-name>
<param-value>true</param-value>
</init-param>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>/pages/jsp/customerinfo.jsp</welcome-file>
</welcome-file-list>

</web-app>

---------------------------------------------------------------------------

CAN YOU PLEASE HELP ME OUT TO FIND THIS EXCEPTION
 
Sumit Malik
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Rajendra you just need to make sure that your actionForm(com.form.SubmitForm) class is placed as

contextRoot/WEB-INF/classes/com/form/SubmitForm.class

What log is saying that you dont have SubmitForm class.....

Just make sure that it is there and then it will run.....


Cheers !!!
Sumit Malik
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic