Hi,

i just switched to Spring version 2.0.4 - now the exception looks a
little bit different:

org.springframework.beans.TypeMismatchException: Failed to convert
property value of type [java.lang.String] to required type
[java.net.InetSocketAddress] for property 'localAddress'; nested
exception is java.lang.IllegalArgumentException: Method must not be
null
        at 
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:385)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1085)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:835)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)

After doing some debugging the cause is that Spring's
BeanWrapperImpl.convertForProperty tries to acquire a
PropertyDescriptor via
cachedIntrospectionResults.getPropertyDescriptor method but this
PropertyDescritor instance has write method set to null for
localAddress Property which causes the later exception. I'm using jdk
1.5...

Christoph

On 5/2/07, Trustin Lee <[EMAIL PROTECTED]> wrote:
On 5/2/07, Christoph Walcher <[EMAIL PROTECTED]> wrote:
> SVN revision 534322 breaks my Spring configuration on JDK 1.5. My
> problem is quite similar to the problem posted by Vic Ganora but the
> fix applied did not work for me.
> The problem seems to occur because the beanInfo for SocketAcceptor
> doesn't report the setter for the localAddress property because
> getLocalAddress returns an instance of INetSocketAddress while the
> related setter accepts SocketAddress instances.
> IMHO it would be more clear to use SocketAddress in both cases and
> furthermore it would solve my problem.
>
>
> Exception extract:
> Exception in thread "main"
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'org.apache.mina.transport.socket.nio.SocketAcceptor'
> defined in file [xxxxx.xml]: Error setting property values; nested
> exception is org.springframework.beans.NotWritablePropertyException:
> Invalid property 'localAddress' of bean class
> [org.apache.mina.transport.socket.nio.SocketAcceptor]: Bean property
> 'localAddress' is not writable or has an invalid setter method. Does
> the parameter type of the setter match the return type of the getter?

Which version of Spring framework are you using?  Did you try with the
latest version of Spring?

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to