Possible IllegalArgumentException with PrivateReaderMethodFinder
11 views
Skip to first unread message
Colin
unread,
Nov 8, 2011, 8:02:55 AM11/8/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to beanlib
I found that if your entity class has a method which resembles a
getter, but takes one or more arguments, then this exception can
occur:
java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at
net.sf.beanlib.provider.BeanPopulator.invokeMethodAsPrivileged(BeanPopulator.java:
221)
at net.sf.beanlib.provider.BeanPopulator.doit(BeanPopulator.java:194)
at
net.sf.beanlib.provider.BeanPopulator.processSetterMethod(BeanPopulator.java:
172)
at net.sf.beanlib.provider.BeanPopulator.populate(BeanPopulator.java:
269)
at
net.sf.beanlib.provider.replicator.ReplicatorTemplate.populateBean(ReplicatorTemplate.java:
194)
at
net.sf.beanlib.provider.replicator.BeanReplicator.replicateBean(BeanReplicator.java:
187)
at
net.sf.beanlib.hibernate3.Hibernate3JavaBeanReplicator.replicateBean(Hibernate3JavaBeanReplicator.java:
71)
at
net.sf.beanlib.provider.replicator.ReplicatorTemplate.replicateByBeanReplicatable(ReplicatorTemplate.java:
144)
at
net.sf.beanlib.provider.replicator.ReplicatorTemplate.replicate(ReplicatorTemplate.java:
139)
at
net.sf.beanlib.provider.BeanTransformer.transform(BeanTransformer.java:
231)
at
net.sf.beanlib.hibernate.HibernateBeanReplicator.copy(HibernateBeanReplicator.java:
134)
at
net.sf.beanlib.hibernate.HibernateBeanReplicator.deepCopy(HibernateBeanReplicator.java:
181)
at
net.sf.beanlib.hibernate.HibernateBeanReplicator.deepCopy(HibernateBeanReplicator.java:
157)
I got around it my creating my own PrivateReaderMethodFinder which
skips methods (returned from beanClass.getDeclaredMethods) that have
arguments.
Hanson Char
unread,
Nov 8, 2011, 12:40:36 PM11/8/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bea...@googlegroups.com
Hi Colin,
Thanks for reporting this. This is now enhanced in the main trunk to avoid this: