WildFly AS 8.0错误:org.hibernate.integrator.spi.Integrator:提供者org.hibernate.envers.event.EnversIntegrator不是子类型 [英] WildFly AS 8.0 Error: org.hibernate.integrator.spi.Integrator: Provider org.hibernate.envers.event.EnversIntegrator not a subtype

查看:202
本文介绍了WildFly AS 8.0错误:org.hibernate.integrator.spi.Integrator:提供者org.hibernate.envers.event.EnversIntegrator不是子类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来自.NET/IIS丰富的背景,尽管我过去曾经使用过Java,但是对于大型Java Web应用程序我还是很陌生,所以请耐心等待.由于我的背景有限,我将逐步尝试从一开始就尝试部署此应用程序的步骤(以防我对另一个问题的修复"可能破坏了其他功能).

I come from a heavy .NET/IIS background and although I have worked with Java in the past, I am fairly new to large Java web applications so please bear with me. Due to my limited background, I will walk through the steps I took from the very start trying to get this app to deploy (in case my "fix" for another issue could have broken something else).

我无法将Spring/Hibernate应用程序部署到WildFly应用程序服务器.该应用程序本身绝对有效,因为它是开源电子商务框架(Broadleaf Commerce)中的示例项目.我还成功地使其在本地的Jetty上运行.

I am having trouble deploying a Spring/Hibernate application to the WildFly application server. The application itself definitely works because it is a sample project in an open-source eCommerce framework (Broadleaf Commerce). I have also successfully got it to run on Jetty locally.

该应用程序使用了我在WildFly/JBoss中配置的三个JNDI数据源;我已经确认该应用程序能够看到它们,因为我在配置DS之前尝试运行它,并且给出了明显的错误,在配置它们之后不再存在.

The application uses three JNDI data sources which I have configured in WildFly/JBoss; I have confirmed that the application sees them because I tried running it prior to configuring the DS's and it gave a clear error, which it no longer did after I configured them.

此后,该应用程序将引发三个不同的错误(每个PU一个),原因是由于类加载异常而无法启动持久性单元.通过将jboss-deployment-structure.xml文件添加到WEB-INF中并包含以下内容,可以解决此错误(根据我的理解,此文件是必需的,因为此应用程序在其WAR文件中包含所有Hibernate JAR已经存在,因此下面的文件告诉JBoss不要提供自己的Hibernate实现):

Afterwards, the application would throw three different errors (one per each PU) saying that it was unable to start the persistence units due to a class loading exception. This error I was able to fix by adding a jboss-deployment-structure.xml file into WEB-INF with the following contents (based on what I understand, this file is needed because this app has all of the Hibernate JARs within its WAR file already, and thus the below file tells JBoss not to supply its own Hibernate implementation):

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <deployment>
        <exclusions>
           <module name="org.hibernate"/>
           <module name="org.javassist"/>
           <module name="org.apache.log4j" />
        </exclusions>
        <dependencies>
            <module name="org.jboss.ironjacamar.jdbcadapters" slot="main"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure>

添加上述文件后,我现在得到了这三个错误(每个PU一个)的集合:

After adding the above file, I now get this set of three (one per each PU) errors:

23:15:16,791 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.persistenceunit."admin.war#blPU".__FIRST_PHASE__: org.jboss.msc.service.StartException in service jboss.persistenceunit."admin.war#blPU".__FIRST_PHASE__: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider org.hibernate.envers.event.EnversIntegrator not a subtype
      service jboss.persistenceunit."admin.war#blSecurePU".__FIRST_PHASE__: org.jboss.msc.service.StartException in service jboss.persistenceunit."admin.war#blSecurePU".__FIRST_PHASE__: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider org.hibernate.envers.event.EnversIntegrator not a subtype
      service jboss.persistenceunit."admin.war#blCMSStorage".__FIRST_PHASE__: org.jboss.msc.service.StartException in service jboss.persistenceunit."admin.war#blCMSStorage".__FIRST_PHASE__: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider org.hibernate.envers.event.EnversIntegrator not a subtype

在WAR档案中有一个名为hibernate-envers-4.1.11.Final.jar的文件.还请记住,这与在Jetty上成功运行的WAR相同(除了jboss-deployment-structure.xml文件).

There is a file called hibernate-envers-4.1.11.Final.jar inside the WAR archive. Also remember that this is the same WAR (except the jboss-deployment-structure.xml file) which ran successfully on Jetty.

我试着四处寻找,但根本不知道在哪里看...我试图在WildFly中更改DS以使用基于JDBC4的驱动程序以及JDBC41(可能与它无关),但是没有运气.我知道这可能很简单,并且与(WildFly或应用程序本身的)配置有关,但是我不确定该在哪里摸索.

I tried poking around but simply have no idea where to look... I tried changing the DS's in WildFly to use a JDBC4-based driver as well as a JDBC41 (probably has nothing to do with it) with no luck. I know it is probably something very simple and is related to configuration (of either WildFly or the application itself), but I am not sure where to poke around.

我完全不敢相信,WildFly仍然以某种方式试图加载旧版本的Hibernate,捆绑的4.1.11 Envers JAR中的类试图覆盖,但不能(反之亦然).

My completely out of the blue take on it is that WildFly is still somehow trying to load an older version of Hibernate, which the classes in the bundled 4.1.11 Envers JAR are trying to override but cannot (or vice versa).

如果有什么用-该应用程序正尝试连接到PostgreSQL 9.3数据库,并且只要单击测试连接"就可以在WildFly中定义DS.

If it is of any use - the app is trying to connect to a PostgreSQL 9.3 database and the DS's defined in WildFly work as far as clicking "Test Connection" goes.

如果我可以提供其他任何有用的信息,请告诉我.

If there is any other info I can provide which would be helpful, please let me know.

任何见解或提示将不胜感激.

Any insights or hints would be very much appreciated.

推荐答案

我从未弄清楚问题的原因(但我认为这与JBoss提供的JAR冲突).

I never figured out the cause of the issue (but I am figuring it was a conflict with the JARs supplied by JBoss).

以防万一有人遇到相同的问题-我最终使用了Tomcat,一切正常.我了解这并非完全解决方案,但可以在此期间使用.这也可能使我最初怀疑JBoss提供的JAR与项目中捆绑的Hibernate JAR冲突.

Just in case anyone is having the same issue - I ended up using Tomcat where everything worked without a hitch. I understand this isn't exactly a solution but it will work in the interim. This also possibly reinforces my initial suspicion of the JARs provided by JBoss conflicting with the bundled Hibernate JARs in the project.

这篇关于WildFly AS 8.0错误:org.hibernate.integrator.spi.Integrator:提供者org.hibernate.envers.event.EnversIntegrator不是子类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆