struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nanu Khota" <nanukh...@rediffmail.com>
Subject Error creating form bean - nullpointerexception - struts 1.2 + weblogic 8.1 + myeclipse 5.5
Date Thu, 01 Apr 2010 11:53:48 GMT
Hi All,
I am a newbee to struts and trying some hands on it. I was just trying to develop a simple
login form but getting following exception on initial run itself.
---------------------------------------------------------------------------------------------
SEVERE: Error creating form bean of class com.abc.struts.form.LoginFormjava.lang.NullPointerExceptionat
org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)at
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191)at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477)at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)at jsp_servlet.__login._jspService(__login.java:196)at
weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
---------------------------------------------------------------------------------------------
I tried searching thru all forums from last 2 days but could not found any solution to the
issue. This seems to be a very common problem but I don't know why its not going away. I am
really stuck up.
Below are the listing of files required to analyize the cause of error.
web.xml------------&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"&gt;&lt;web-app&gt;&nbsp;
&lt;servlet&gt;&nbsp;&nbsp;&nbsp; &lt;servlet-name&gt;action&lt;/servlet-name&gt;&nbsp;&nbsp;&nbsp;
&lt;servlet-class&gt;org.apache.struts.action.ActionServlet&lt;/servlet-class&gt;&nbsp;&nbsp;&nbsp;
&lt;init-param&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;param-name&gt;config&lt;/param-name&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;param-value&gt;/WEB-INF/struts-config.xml&lt;/param-value&gt;&nbsp;&nbsp;&nbsp;
&lt;/init-param&gt;&nbsp;&nbsp;&nbsp; &lt;init-param&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;param-name&gt;debug&lt;/param-name&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;param-value&gt;3&lt;/param-value&gt;&nbsp;&nbsp;&nbsp; &lt;/init-param&gt;&nbsp;&nbsp;&nbsp;
&lt;init-param&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;param-name&gt;detail&lt;/param-name&gt;&nbsp;&nbsp;&nbsp;&
 nbsp;&nbsp; &lt;param-value&gt;3&lt;/param-value&gt;&nbsp;&nbsp;&nbsp;
&lt;/init-param&gt;&nbsp;&nbsp;&nbsp; &lt;load-on-startup&gt;0&lt;/load-on-startup&gt;&nbsp;
&lt;/servlet&gt;&nbsp; &lt;servlet-mapping&gt;&nbsp;&nbsp;&nbsp;
&lt;servlet-name&gt;action&lt;/servlet-name&gt;&nbsp;&nbsp;&nbsp;
&lt;url-pattern&gt;*.do&lt;/url-pattern&gt;&nbsp; &lt;/servlet-mapping&gt;&nbsp;
&lt;welcome-file-list&gt;&nbsp;&nbsp;&nbsp; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;&nbsp;
&lt;/welcome-file-list&gt;&nbsp; &lt;taglib&gt;&nbsp; &nbsp;&lt;taglib-uri&gt;/WEB-INF/struts-html.tld&lt;/taglib-uri&gt;&nbsp;
&nbsp;&lt;taglib-location&gt;/WEB-INF/struts-html.tld&lt;/taglib-location&gt;&nbsp;
&lt;/taglib&gt;&lt;/web-app&gt;
index.jsp---------......&lt;body&gt;&nbsp;&nbsp;&nbsp; &lt;html:link
page="/home.do"&gt;Login&lt;/html:link&gt;&nbsp; &lt;/body&gt;.....
struts-config.xml-----------------&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;!DOCTYPE
struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"&gt;
&lt;struts-config&gt;&nbsp; &lt;data-sources /&gt;&nbsp; &lt;form-beans
&gt;&nbsp;&nbsp;&nbsp; &lt;form-bean name="loginForm" type="com.siemens.struts.form.LoginForm"
/&gt;
&nbsp; &lt;/form-beans&gt;
&nbsp; &lt;global-exceptions /&gt;&nbsp; &lt;global-forwards /&gt;&nbsp;
&lt;action-mappings &gt;&nbsp;&nbsp;&nbsp; &lt;action&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
attribute="loginForm"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name="loginForm"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
path="/empLogin"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scope="request"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
type="com.siemens.struts.action.EmpLoginAction"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
validate="false" /&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;action forward="/Login.jsp" path="/home" /&gt;
&nbsp; &lt;/action-mappings&gt;
&nbsp; &lt;message-resources parameter="com.siemens.struts.ApplicationResources" /&gt;&lt;/struts-config&gt;
Login.jsp---------
&lt;body&gt;&nbsp;&nbsp;&nbsp; &lt;html:form action="/empLogin" method="post"
focus="login"&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;table border="0"&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;tr&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;td&gt;Login:&lt;/td&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;td&gt;&lt;html:text property="login" /&gt;&lt;/td&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/tr&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;tr&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;td&gt;Password:&lt;/td&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;td&gt;&lt;html:password property="password" /&gt;&lt;/td&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/tr&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;tr&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;td colspan="2" align="center"&gt;&lt;html:submit&gt;Login&lt;/html:submit&gt;&lt;/td&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
 p;&nbsp;&nbsp; &lt;/tr&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/table&gt;&nbsp;&nbsp;&nbsp; &lt;/html:form&gt;&nbsp;
&lt;/body&gt;
I can also provide the form bean and action class if required but I believe it won't add to
solving the problem as the exception occurs when I click on the link on index.jsp and then
it tries to render the Login.jsp.
Please help.
Regards,Nanu
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message