commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Price <epr...@ptc.com>
Subject [digester] No such accessible method
Date Wed, 13 Aug 2003 20:34:00 GMT
Hi,

I've been happily using Digester for about six months now, but suddenly 
it's stopped working for me and I just can't figure out why.  I'm hoping 
someone on this list can point out my mistake.

I instantiate a digester instance, push an object instance onto it (of 
type "com.ptc.oatmeal.Criteria") and call a gamut of methods on the 
Criteria.  This works fine.  But one of the methods throws an 
IOException, and when I catch this exception, unwrap it, and log it, it 
is this:

2140 [main] DEBUG org.apache.commons.beanutils.MethodUtils  - Matching 
name=setParentRequirementId on class com.ptc.oatmeal.Criteria
2140 [main] DEBUG org.apache.commons.beanutils.MethodUtils  - Found 
matching name:
2140 [main] DEBUG org.apache.commons.beanutils.MethodUtils  - public 
void com.ptc.oatmeal.Criteria.setParentRequirementId(int)
2140 [main] DEBUG org.apache.commons.beanutils.MethodUtils  - 
Param=java.lang.String
2140 [main] DEBUG org.apache.commons.beanutils.MethodUtils  - Method=int
2140 [main] DEBUG org.apache.commons.beanutils.MethodUtils  - int is not 
assignable from class java.lang.String
2140 [main] DEBUG org.apache.commons.beanutils.MethodUtils  - No match 
found.
2156 [main] ERROR org.apache.commons.digester.Digester  - End event 
threw exception
java.lang.NoSuchMethodException: No such accessible method: 
setParentRequirementId() on object: com.ptc.oatmeal.Criteria
	at 
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:250)
	at org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:505)



How do I cast the String in my XML file (which is simply a number) to an 
integer so I can pass it to the "setParentRequirementId" method?


Thanks,

Erik


Mime
View raw message