File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error msg: No bean specified

 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you ever figure out this problem? I am having a similar issue.

TIA
 
mariellen mihopoulos
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Azzopardi
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nathan Hook
Ranch Hand
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic