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属性绑定的,
  • 相关阅读:
    C# Asp.net 获取上上次请求的url
    Asp.net 中 Get和Post 的用法
    慎用JavaScript:void(0)
    JS验证RadioButton列表或CheckBox列表是否已填写
    .net 中viewstate的原理和使用
    Javascript与C#互相调用
    获取当前页面URL并UTF8编码之
    C#信息采集工具实现
    C#泛型编程
    C#正则表达式提取HTML中IMG标签的URL地址 .
  • 原文地址:https://www.cnblogs.com/YJBlog/p/10440701.html
Copyright © 2011-2022 走看看