我想建立一个Spring MVC + Hibernate WAR部署到Jboss 7.1.1 Final。我的应用程序使用Hibernate 3.6.1 &到目前为止,我的理解是Hibernate 4与AS一起打包,并且是默认的持久性提供程序。我没有使用persistent.xml文件配置。如何用Jboss7设置hibernate3?
我已经提供了所有必需的java,但我仍然遇到以下异常,任何人都可以帮助我设置JBoss中的hibernate 3相关更改吗?
03:14,597 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-3)
Context initialization failed:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'hibernateVendor' defined in ServletContext resource [/WEB-INF/hibernate-context.xml]:
Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException:
Could not instantiate bean class [org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter]:
Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/ejb/HibernatePersistence
您使用的是jboss-deployment-structure.xml吗? – 2015-03-25 09:08:46
不,我试图在这个路径上手动设置hibernate 3的相关配置:AS/modules/org/hibernate/3并添加了所有需要的jar文件和创建的module.xml文件。我正走在正确的道路上吗? – 2015-03-25 09:20:38