Announcement Announcement Module
Collapse
No announcement yet.
Upgrading to 1.0.0.RC1 causes my custom <mvc:message-converters> to fail in web confi Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upgrading to 1.0.0.RC1 causes my custom <mvc:message-converters> to fail in web confi

    I am using spring v3.1.0.RC2.

    When I try to run a functional test that loads up my webmvc-config.xml file, that includes the bean:

    Code:
    <mvc:annotation-driven conversion-service="conversionService">
            <mvc:argument-resolvers>
                <bean class="org.springframework.mobile.device.DeviceWebArgumentResolver"/>
                <bean class="org.springframework.mobile.device.site.SitePreferenceWebArgumentResolver"/>
            </mvc:argument-resolvers>
            <mvc:message-converters>
                <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
                    <property name="supportedMediaTypes" value="application/json"/>
                    <property name="objectMapper">
                        <bean class="com.lela.utils.jackson.CustomObjectMapper"/>
                    </property>
                </bean>
            </mvc:message-converters>
        </mvc:annotation-driven>
    The message converter fails with the message:
    Code:
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.http.converter.json.MappingJacksonHttpMessageConverter#0' defined in class path resource [webmvc-config.xml]: Initialization of bean failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 1
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:526)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
    	... 46 more
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
    	at org.springframework.data.mongodb.config.ServerAddressPropertyEditor.setAsText(ServerAddressPropertyEditor.java:44)
    	at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:419)
    	at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:391)
    	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:159)
    	at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:470)
    	at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:517)
    	at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:510)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1395)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1354)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1107)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516)
    	... 48 more
    I am assuming this has something to do with the DATAMONGO-301 issue.

    Any ideas on how to proceed here if it is not a bug? Note that when I start the application in Tomcat I do not get this error. Only when I run a test.
Working...
X