我们有一个在 Hibernate 3.6 中开发的应用程序,我们需要将它部署到客户端的 JBoss 4.0.5 应用服务器上。
由于 JBoss 类加载流程,我们应用程序上的 hibernate 库没有加载,而是使用了与 JBoss 一起提供的 hibernate,这导致了很多问题。
对 tomcat 的检查jboss-service.xml
显示设置已被修改:
<attribute name="Java2ClassLoadingCompliance">true</attribute> <!--modified-->
<attribute name="UseJBossWebLoader">false</attribute> <!--remained the same-->
Java2ClassLoadingCompliance
设置为 true 后,我们是否可以在应用程序中指定类加载隔离?我们在引用此处jboss-web.xml
的应用程序目录中设置以下设置(应用程序部署为爆炸战):WEB-INF
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
org.hibernate:archive=OurApplication.war
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
</jboss-web>
但是配置没有效果。
非常感谢任何输入。