javax.servlet.jsp.JspException: Exception creating bean.....
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, May 7, 2007 02:22 AM

Hi, I am using struts 1.3.8 with weblogic 9.2 Application server. When I am including i.e whenever I am trying to use the tag,I am getting the following exception: May 7, 2007 11:21:16 AM org.apache.struts.util.RequestUtils createActionForm SEVERE: Error creating form bean of class java.formbeans.BaseFormBean java.lang.NullPointerException at org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:289) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:254) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:208) at org.apache.struts.taglib.html.FormTag.initFormBean(FormTa   More>>

Hi,
I am using struts 1.3.8 with weblogic 9.2 Application server. When I am including i.e whenever I am trying to use the tag,I am getting the following exception:

May 7, 2007 11:21:16 AM
org.apache.struts.util.RequestUtils createActionForm

SEVERE: Error creating form bean of class
java.formbeans.BaseFormBean

java.lang.NullPointerException

at org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:289)

at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:254)

at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:208)

at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:505)

at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:482)

at jsp_servlet._view._jsps.__formbeanex._jsp__tag1(__formbeanex.java:162)

at jsp_servlet._view._jsps.__formbeanex._jsp__tag0(__formbeanex.java:135)

at jsp_servlet._view._jsps.__formbeanex._jspService(__formbeanex.java:104)

at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)

at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)

at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)

at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)

at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:391)

at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:309)

at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3214)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)

at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)

at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1890)

at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

May 7, 2007 11:21:16 AM org.apache.struts.util.PropertyMessageResources loadLocale

WARNING: Resource org/apache/struts/taglib/html/LocalStrings_en_US.properties Not Found.

May 7, 2007 11:21:16 AM org.apache.struts.util.PropertyMessageResources loadLocale

WARNING: Resource org/apache/struts/taglib/html/LocalStrings_en.properties Not Found.

<[weblogic.servlet.internal.WebAppServletContext@32ee80
- appName: '_appsdir_loginEx_war', name: 'loginEx.war', context-path: '/loginEx'] Root cause of ServletException.
javax.servlet.jsp.JspException: Exception creating bean of class java.formbeans.BaseFormBean: {1}
at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:515)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:482)
at jsp_servlet._view._jsps.__formbeanex._jsp__tag1(__formbeanex.java:162)
at jsp_servlet._view._jsps.__formbeanex._jsp__tag0(__formbeanex.java:135)
at jsp_servlet._view._jsps.__formbeanex._jspService(__formbeanex.java:104)
Truncated. see log file for complete stacktrace
>

following are the files that I am working with:

struts-config.xml


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



"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">




































formBean.jsp


& <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>

& <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>

& <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>










Hi! This is FormBean Example.









BaseFormBean.java


package java.formbeans;


import org.apache.struts.action.ActionForm;


public class BaseFormBean extends ActionForm {


private static final long serialVersionUID = 1L;


private String language = null;

private String country = null;


public BaseFormBean ()

{

super ();

}


public String getCountry() {

return country;

}

public void setCountry(String country) {

this.country = country;

}

public String getLanguage() {

return language;

}

public void setLanguage(String language) {

this.language = language;

}



}

Awating for the response. Thanking you in advance for the help.


Thanks & Regards
Shasi Rekha Engala

   <<Less

Re: javax.servlet.jsp.JspException: Exception creating bean.....

Posted By:   Anonymous  
Posted On:   Monday, May 7, 2007 03:30 AM

The package structure I was using is java.formbeans. XXX

If the folder structure is changed the problem is solved.

Re: javax.servlet.jsp.JspException: Exception creating bean.....

Posted By:   Anonymous  
Posted On:   Monday, May 7, 2007 03:28 AM

in the action attribute you are supposed to enter your actionPath which is configured in struts-config.xml. So The action attribute cannot be null/empty
About | Sitemap | Contact