我们正在从 Jboss AS 7.1 迁移到 Jboss EAP 7.3.0 ,并且出现以下错误:
<<
22:36:16,304 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."ejb-application.ear".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."ejb-application.ear".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "ejb-application.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0019: Could not deploy application packaged persistence provider 'org.hibernate.jpa.HibernatePersistenceProvider'
at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(PersistenceProviderHandler.java:80)
at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:49)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
... 8 more
Caused by: java.lang.ClassCastException: class org.hibernate.jpa.HibernatePersistenceProvider
at java.lang.Class.asSubclass(Class.java:3404)
at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(PersistenceProviderHandler.java:73)
... 10 more
>>
这是我们的Persistence.xml文件
<<
<persistence version="2.1"
xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="jboss">
<!-- If you are running in a production environment, add a managed
data source, this example data source is just for development and testing! -->
<!-- The datasource is deployed as WEB-INF/hibernate-quickstart-ds.xml, you
can find it in the source at src/main/webapp/WEB-INF/hibernate-quickstart-ds.xml -->
<jta-data-source>java:jboss/jdbc/AppDatasource</jta-data-source>
<properties>
<!-- Properties for Hibernate -->
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="false" />
</properties>
</persistence-unit>
</persistence>
>>
我们知道这与persistence.xml和jboss-deployment-structure.xml文件有关。 我们试图在文件中包括/排除所有相关模块,但仍然遇到上述问题。 另外,我们正在从Hibernate 3迁移到Hibernate 5。
请帮助解决此问题。
答案 0 :(得分:1)
好像您可能将Hibernate和您的应用程序打包在不同版本中,或者您在jboss-deployment-structure.xml中排除了Hibernate版本