我想建立一個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