zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    二维前缀和
    素数筛法
    dp-最大连续子序列的和
    dp-最长递增子序列 (LIS)
    dp-完全背包(题)
    dp-多重背包
    dp-完全背包
    DP-01背包 (题)
    DP- 01背包问题
    DP-直线分割递推
  • 原文地址:https://www.cnblogs.com/JNUX/p/7457110.html
Copyright © 2011-2022 走看看