Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

java.lang.IllegalArgumentException: No destination bean specified

807589Jan 4 2007 — edited Oct 3 2008
I am using MyActionForm extending ActionForm and created an instance of that in the action class.

I am writing..
BeanUtils.copyProperties(actionForm,myActionForm);
actionForm....ActionForm obj in the action.
myActionForm ... Bean(form) obj that is extending ActionForm.

I am getting the folowing exception...
java.lang.IllegalArgumentException: No destination bean specified
I have set some the values of the form and forwarding to a JSP page where I have the matching propertiees.

I have used the copyProps many time and never got the above exception.

Did a lot of check and could not find what is going on.

Appreciate help.

Comments

807589 Jan 4 2007
Are you sure you don't have the arguments reversed? the Dest should be first and the source should be second. Just a thought.

~Tim
807589 Jan 4 2007
My destination is ActionForm obj in my case actionForm and the source is Form bean that has the matching props set.

I logged the values in the form bean they are also printing the values i assigned.

Pl suggest
807589 Jan 4 2007
Well, are you sure actionForm is not null at the point you are copying to it, an dthe myActionForm also is not null?

According to the API, This method throws an IllegalArgumentException if either of the arguments is null.

I would do a System.out.print() just prior to the method call to make sure they aren't null.


~Tim
807589 Jan 4 2007
I have fixed the issue.

Very silly mistake I made.

I forgot to add name =MyForm in the struts-config.

Sorry to bother the forum experts.

Lesson Learnt....I feel pity on my self.
807589 Oct 3 2008
You must have destination object null; Just initialize that and try I am sure it will work.
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 31 2008
Added on Jan 4 2007
5 comments
381 views