GeeCON Prague 2014*
The moose likes Struts and the fly likes Error creating form bean in a simple struts application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error creating form bean in a simple struts application" Watch "Error creating form bean in a simple struts application" New topic
Author

Error creating form bean in a simple struts application

shanky raja
Greenhorn

Joined: Dec 19, 2011
Posts: 17

Hi All,

I have been trying to resolve this issue for last 2 days but of no help. Please check why am i getting this error.

This is the exception i am getting on my browser

org.apache.jasper.JasperException: An exception occurred processing JSP page /login.jsp at line 12

9: <h1>Java Learning centre</h1>
10: <h2> User Login </h2>
11: <font color=red size=5>${EMSG}</font>
12: <html:form action="/LoginSubmit">
13: <table>
14: <tr>
15: <td>username:</td>


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: Exception creating bean of class com.jlcindia.Struts1.LoginForm under form name LoginForm
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.login_jsp._jspService(login_jsp.java:83)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

javax.servlet.jsp.JspException: Exception creating bean of class com.jlcindia.Struts1.LoginForm under form name LoginForm
org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:536)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:503)
org.apache.jsp.login_jsp._jspx_meth_html_005fform_005f0(login_jsp.java:138)
org.apache.jsp.login_jsp._jspx_meth_html_005fhtml_005f0(login_jsp.java:110)
org.apache.jsp.login_jsp._jspService(login_jsp.java:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


This is what i am getting in my console window:

SEVERE: Error creating form bean of class com.jlcindia.Struts1.LoginForm
java.lang.NullPointerException

at org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:289)
at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:259)
at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:213)
at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:526)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:503)
at org.apache.jsp.login_jsp._jspx_meth_html_005fform_005f0(login_jsp.java:132)
at org.apache.jsp.login_jsp._jspx_meth_html_005fhtml_005f0(login_jsp.java:104)
at org.apache.jsp.login_jsp._jspService(login_jsp.java:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
11 Dec, 2012 1:50:10 AM org.apache.struts.util.PropertyMessageResources loadLocale
WARNING: Resource org/apache/struts/taglib/html/LocalStrings_en_IN.properties Not Found.
11 Dec, 2012 1:50:10 AM org.apache.struts.util.PropertyMessageResources loadLocale
WARNING: Resource org/apache/struts/taglib/html/LocalStrings_en.properties Not Found.
11 Dec, 2012 1:50:10 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Exception creating bean of class com.jlcindia.Struts1.LoginForm under form name LoginForm

at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:536)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:503)
at org.apache.jsp.login_jsp._jspx_meth_html_005fform_005f0(login_jsp.java:132)
at org.apache.jsp.login_jsp._jspx_meth_html_005fhtml_005f0(login_jsp.java:104)
at org.apache.jsp.login_jsp._jspService(login_jsp.java:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)



Below are the files used:-

login.jsp



home.jsp



LoginForm.java




LoginAction.java



web.xml



jlcindia-config.xml



messages.properties

Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Have a look this FAQs entry regarding CannotCreateBean.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
shanky raja
Greenhorn

Joined: Dec 19, 2011
Posts: 17

Hi Saifuddin,

Thanks for the quick response, but still i could not find any errors when checked with the FAQs entry.
shanky raja
Greenhorn

Joined: Dec 19, 2011
Posts: 17

Hi Bear,

I am sorry for the inconvenience caused. Will not repeat the same mistake next time onwards.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Error creating form bean in a simple struts application