_GoldenRain
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\Workspace\HrManager02\WebRoot\WEB-INF\classes\config\spring\spring-common.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.OneToOne.orphanRemoval()Z 异常原因:hibernate-jpa-2.0-api-1.0.0.Final.jar会和ejb3-persistence.jar里很多重复,难免会出现冲突情况。java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider;是在整合spring3.2和Hibernate4中Hibernate4将Hibernate3的一些功能修改了,不再使用CacheProvider了,因此将配置文件的下面两行修改一下://配置sessionFactory <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> //配置事务<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"将其中的3改为4即可。java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection 刚开始我以为是实体出错,后来重启了一下项目出现这个错,才发现Oracle服务没开。