*
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Exception creating bean of class com.user" Watch "Exception creating bean of class com.user" New topic
Author

Exception creating bean of class com.user

Pramod Kumar
Ranch Hand

Joined: Oct 05, 2007
Posts: 40
Hi,

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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception creating bean of class com.user