[1.2.4] Can't read GenericModel fields by reflection

33 views
Skip to first unread message

Célio

unread,
Dec 27, 2011, 1:55:27 PM12/27/11
to play-framework
I'm using PropertyUtils.getProperty() (from commons-beanutils) to read
fields from some models that extend GenericModel and it stopped
working after I upgraded from 1.2.3 to 1.2.4. It now throws a
NoSuchMethodException: Unknown property 'foo' on class 'class
models.Bar'. To be sure that it's a version issue, I downgraded to
1.2.3 and it worked fine. Upgraded again to 1.2.4, failed again. Also
tried reading it without PropertyUtils (with
Class.getDeclaredField(..), etc).

Did anyone else experience this problem? Does Play now do some
instrumentation trick that prevents me from having access to my fields
via reflection?

Reproduction of the error is simple. Create a new project, create a
model that extends from GenericModel, add some fields to it, use
PropertyUtils.getProperty() to read one of the fields. Try it with
Play 1.2.3 first, then switch to 1.2.4.

Célio

Blert

unread,
May 11, 2012, 9:56:05 AM5/11/12
to play-fr...@googlegroups.com
Seems to be the same like this ...

Reply all
Reply to author
Forward
0 new messages