• Spring ConversionFailedException: Failed to convert from type java.util.ArrayList<?> to type java.util.List<org.springframework.core.io.Resource>


    org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.util.ArrayList<?>] to type [java.util.List<org.springframework.core.io.Resource>] 
    for value '[/assets/]'; nested exception is org.springframework.core.convert.ConverterNotFoundException:
    No converter found capable of converting from type [java.util.ArrayList<?>] to type [org.springframework.core.io.Resource]

    原因beanID冲突

    源代码样式

        <mvc:annotation-driven conversion-service="conversionService">
            <mvc:message-converters>
                <bean class="org.springframework.http.converter.StringHttpMessageConverter" />
                <bean
                    class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
            </mvc:message-converters>
        </mvc:annotation-driven>
        <bean id="conversionService"
            class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
            <property name="formatters">
                <set>
                    <bean class="com.ivlo.crm.extend.MyDateFormatter"></bean>
                </set>
            </property>
        </bean>
        <mvc:resources mapping="/assets/**" location="/assets/" />

    将conversionService 换一个ID名称 例如 conversionDateService 既可以正常运行了

    原因 http://www.cnblogs.com/susua/p/5571590.html

  • 相关阅读:
    团队冲刺2.7
    单词接龙
    团队冲刺2.6
    梦断代码阅读笔记02
    团队冲刺2.5
    吾日三省吾身(6)
    吾日三省吾身(5)
    周计划01(20200921-20200927)
    吾日三省吾身(4)
    吾日三省吾身(3)
  • 原文地址:https://www.cnblogs.com/JNUX/p/7457110.html
Copyright © 2020-2023  润新知