wood burning stoves
The moose likes Struts and the fly likes Exception creating bean of class com.user Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Exception creating bean of class com.user" Watch "Exception creating bean of class com.user" New topic

Exception creating bean of class com.user

Pramod Kumar
Ranch Hand

Joined: Oct 05, 2007
Posts: 40

I have created a bean that doesn't extends ActionForm, and I am getting the following exception.


javax.servlet.jsp.JspException: Exception creating bean of class com..User: {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._myusers.__userbody._jsp__tag0(__userbody.java:146)
at jsp_servlet._myusers.__userbody._jspService(__userbody.java:121)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)

Is that compulsory that for every bean we have to extend ActionForm? With out ActionForm can we use beans for forms in struts? The class files are in classpath. Any idea?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If you reference a JavaBean in a <form-bean> tag in a struts-config.xml file, it must have ActionForm somewhere in it's hierarchy of superclasses.

Your main ActionForm can reference other JavaBeans that do not extend ActionForm, but the main form bean associated with an action must extend ActionForm.

I saw something else in your stack trace that concerns me: "com..User" is not a valid fully qualified class name. Did you edit the stack trace before posting it? If not, check your config file and make sure that it's specified properly.

Consultant, Sima Solutions
I agree. Here's the link: http://aspose.com/file-tools
subject: Exception creating bean of class com.user
It's not a secret anymore!