Struts2.3.14+Spring3.2.2+Hibernate4.3.0 整合常见问题

异常1:java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

解决方法:Struts2的lib引入commons-logging-1.1.1.jar

异常2:java.lang.NoClassDefFoundError: org/springframework/dao/support/PersistenceExceptionTranslator

解决方法:Spring的lib引入spring-tx-3.2.2.RELEASE.jar

异常3:java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider

解决方法:applicationContext.xml里加入


   


异常4:Specified JDBC Driver com.mysql.jdbc.Driver could not be loaded

解决方法:添加Jar包:mysql-connector-java-5.1.7-bin.jar


配置事务时异常5:spring里配置事务依赖的jar包有:

commons-logging-1.1.1.jar

aopalliance-1.0.jar

aspectjweaver.jar //spring之前版本里找

log4j-1.2.17.jar


junit测试jar包引入:junit-4.11.jar



你可能感兴趣的:(Java,EE,Spring,Hibernate,Struts)