//異常一:
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>不行