[1.2.5] Problem using BeanUtils.copyProperties : do nothing

351 views
Skip to first unread message

Xavier NOPRE

unread,
Dec 16, 2012, 4:23:58 PM12/16/12
to play-framework
Hi,

With Play! 1.2.5, I'm using BeanUtils.copyProperties(dest, src). 

In a controller, I received an object "P" in JSON format, I transform it to P java object, and then, I'm using BeanUtils.copyProperties to copy received properties to the local persistent object.

In my local host, it works. But when I deploy my application as WAR under tomcat server, it doesn't work, no error message, but the fields seems to be not copied ...

Any idea ?

Thanks,

Xavier

Tom Carchrae

unread,
Dec 16, 2012, 6:39:21 PM12/16/12
to play-fr...@googlegroups.com
I've hit that one too - exactly the same thing, runs local but fails
deployed. Really annoying and I never got to the bottom of it. I
suspect it is caused by different versions of the JDK (eg OpenJDK
deployed and Oracle local). I now try and avoid the whole
BeanUtils/PropertyUtils libs.

I use Jackson for most of my JSON parsing and it allows you to update
beans from JSON like this: new
ObjectMapper().updatingReader(existingBean).readValue("{ \"name\" :
\"Jackson\"}"); ( from
http://jackson-users.ning.com/profiles/blogs/new-feature-ability-to-update
)

Perhaps there is something similar for GSON.

Tom
> --
>
>

Am1t

unread,
Oct 1, 2013, 11:01:06 AM10/1/13
to play-fr...@googlegroups.com, t...@carchrae.net
Thanks, that helped. 
Indeed it was changing to Oracle JDK from OpenJDK which solved it for me.
Reply all
Reply to author
Forward
0 new messages