From: Brett B. <br...@po...> - 2003-10-24 18:48:32
|
Hi all, soz i haven't been around for ages. I have been trying out the XMLBeanFactory and I have defined a JavaBean which has an Integer property which Spring doesn't like. I can define value for Longs and Strings but it throws an exception when it tries to convert a String(in the xml file) to an Integer. Can you throw any light on this... cheers in advance (the stacktrace is below). Brett PropertyVetoExceptionsException: 1 errors:-- ErrorCodedPropertyVetoException: message=[Failed to convert property value of type [java.lang.String] to required type [java.lang.Integer] for property named 'age'; nested exception is: java.lang.IllegalArgumentException: argument type mismatch]; errorCode=[typeMismatch] java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:531) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:590) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:567) at org.springframework.beans.factory.support.AbstractBeanFactory.applyPropertyValues(AbstractBeanFactory.java:375) at org.springframework.beans.factory.support.AbstractBeanFactory.createBean(AbstractBeanFactory.java:309) at org.springframework.beans.factory.support.AbstractBeanFactory.getSharedInstance(AbstractBeanFactory.java:224) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156) at brett.ioc.ApplicationContext.create(ApplicationContext.java:24) at brett.ioc.SpringStuff.execute(SpringStuff.java:10) at brett.Demo.main(Demo.java:40) |