zoukankan      html  css  js  c++  java
  • SSM配置中出现的错误-实时更新

    1. 错误一:出现异常

    Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'javax.sql.DataSource' for property 'dataSource'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'javax.sql.DataSource' for property 'dataSource': no matching editors or conversion strategy found
    	at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:603)
    	at org.springframework.beans.AbstractNestablePropertyAccessor.convertForProperty(AbstractNestablePropertyAccessor.java:615)
    	at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:216)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1583)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1542)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1284)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
    	... 38 more
    Caused by: java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'javax.sql.DataSource' for property 'dataSource': no matching editors or conversion strategy found
    	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:307)
    	at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:588)
    	... 44 more
    

    因为你前面已经定义了DataSource 的bean

    所以后面的 关于dataSource 要写成ref的形式

     <property name="dataSource" value="pooledDataSource"></property>
    

    像上面类似的,,都要改写成

    <property name="dataSource" ref="pooledDataSource"></property>
    

    2.错误2- 后台无法获取前端的值

    1. 如果你的ssm架子,,是从前台jsp页面获取的数据,想要简单开发,,实现 属性与POJO类的属性的帮点
    2. 你必须要确定,,ssm中的绑定是POJO类的属性 与 前台的name属性绑定的,
  • 相关阅读:
    P1001 A+B Problem
    NOIP2015D1T2 信息传递
    海淀区赛游记。。。。
    P3375 【模板】KMP字符串匹配
    Print Article HDU
    BZOJ-2-4870: [Shoi2017]组合数问题 矩阵优化 DP
    BZOJ-1- 4868: [Shoi2017]期末考试-三分
    #6164. 「美团 CodeM 初赛 Round A」数列互质-莫队
    湖南大学第十四届ACM程序设计新生杯(重现赛)
    Codeforces Round #530 (Div. 2)
  • 原文地址:https://www.cnblogs.com/YJBlog/p/10440701.html
Copyright © 2011-2022 走看看