wood burning stoves 2.0*
The moose likes Struts and the fly likes Error msg: No bean specified Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error msg: No bean specified " Watch "Error msg: No bean specified " New topic
Author

Error msg: No bean specified

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hello I have a problem with:
java.lang.IllegalArgumentException: No bean specified
java.beans.PropertyDescriptor org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(java.lang.Object, java.lang.String)
PropertyUtils.java:816
void org.apache.commons.beanutils.BeanUtils.setProperty(java.lang.Object, java.lang.String, java.lang.Object)
BeanUtils.java:846
void org.apache.commons.beanutils.BeanUtils.populate(java.lang.Object, java.util.Map)
BeanUtils.java:726
void org.apache.struts.util.RequestUtils.populate(java.lang.Object, java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest)
RequestUtils.java:978
void org.apache.struts.action.RequestProcessor.processPopulate(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.ActionForm, org.apache.struts.action.ActionMapping)
RequestProcessor.java:779
void org.apache.struts.action.RequestProcessor.process(javax.servlet.http

When iidObdobjaLastnistva from combo box is chosen and the submit is done, then i try another submit anf this error msg is thrown
Shabeen Jafri
Greenhorn

Joined: Dec 30, 2002
Posts: 6
Did you ever figure out this problem? I am having a similar issue.

TIA
mariellen mihopoulos
Greenhorn

Joined: Feb 02, 2005
Posts: 1
In your form you need to have instantiated your objects (duno how to say it, new to java/struts). I have had this problem about 5 times, and I always forget.

eg instead of

private User myUser;

you need

private User myUser = new User();

hope that helps - apparently this message is displayed for other errors as well.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Seeing (java.lang.Object, java.lang.String) in your post leads me to believe you are using map-backed forms.

Mariellen is more than likely right on the nose in that your map is null.


A good workman is known by his tools.
Tim Azzopardi
Greenhorn

Joined: Feb 25, 2005
Posts: 1
I had similar problem
java.lang.IllegalArgumentException: No bean specified
at org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:837)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:934)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)


reason was as follows
Struts config for form was
<form-bean name="itemForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="art" type="com.tigerfive.struts.ArtForStruts" />
</form-bean>
But ArtForStruts class had no default constructor.


<a href="http://www.TigerFive.com" target="_blank" rel="nofollow">www.TigerFive.com</a>
Nathan Hook
Ranch Hand

Joined: Jan 10, 2005
Posts: 81
Since ArtForStruts (strange name for an Object...) doesn't meet the java bean standards, then you can't use it in the way you are trying to.

You might want to look at a Java Bean tutorial here:
http://java.sun.com/docs/books/tutorial/javabeans/

Best of Luck,

Nate
Doug Emery
Greenhorn

Joined: Aug 08, 2002
Posts: 1
I had this same problem, the "No bean specified" error --



-- in a case where I was using a indexed sub-form properties. In order set a property like childForm[0].field1, Struts has to get a ChildForm instance from a call to


I was quietly returning null if no form instance was found at index i.

I changed my code from:



to:

Rhea Karnam
Greenhorn

Joined: May 06, 2003
Posts: 21
I had the same problem too. In my case, my ActionForm had a couple of ImageButtonBeans (ofcourse, not intialized). I had overriden the action form's reset() method to reset the X and Y coordinates of the ImageButtonBeans. I was clueless why the exception was thrown. Initializing the ImageButtonBeans to new ImageButtonBean(), in the ActionForm's constructor solved the problem.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Error msg: No bean specified