SSH 过程遇到的问题_有空就更新

//异常一:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userAction' defined in file [D:\apache-tomcat-6.0.35\webapps\Simple_SSH_Demo\WEB-INF\classes\applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy0 implementing com.xbw.biz.UserBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xbw.biz.impl.UserBizImpl] for property 'userBiz'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0 implementing com.xbw.biz.UserBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xbw.biz.impl.UserBizImpl] for property 'userBiz': no matching editors or conversion strategy found

Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy0 implementing com.xbw.biz.UserBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xbw.biz.impl.UserBizImpl] for property 'userBiz'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0 implementing com.xbw.biz.UserBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xbw.biz.impl.UserBizImpl] for property 'userBiz': no matching editors or conversion strategy found
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0 implementing com.xbw.biz.UserBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xbw.biz.impl.UserBizImpl] for property 'userBiz': no matching editors or conversion strategy found

Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0 implementing com.xbw.biz.UserBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xbw.biz.impl.UserBizImpl] for property 'userBiz': no matching editors or conversion strategy found

spring的注入依赖的是抽象接口,把Action中须要由spring容器注入的UserBizImpl userBiz ,改为UserBiz userBizjava

UserBiz是接口,UserBizImpl实现了这个接口。在配置的eg:applicationContext.xml文件中写注入具体的实现类。mysql

//异常:(SSH整合异常)web服务器启动后hibernate没有自动生成表web

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'db_dwr.userinfo' doesn't exist
解决:applicationContext.xml配置为<prop key="hibernate.hbm2ddl.auto">update</prop>
!!测试<prop key="hibernate.hbm2ddl.auto">update</prop>不行
相关文章
相关标签/搜索