gpt4 book ai didi

java - JBAS011445 : Failed to get adapter for persistence provider using WildFly

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:59:03 25 4
gpt4 key购买 nike

我们正在将 Java 7 和 JBoss 7 迁移到 Wildfly 和 Java 8。

过程中出现错误。

  16:38:51,323 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.subunit."foo_all.ear"."foo_sb.jar".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."foo_all.ear"."foo_sb.jar".FIRST_MODULE_USE: JBAS018733: Failed to process phase FIRST_MODULE_USE of subdeployment "foo_sb.jar" of deployment "foo_all.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_45]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_45]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011445: Failed to get adapter for persistence provider 'de.foo.FooHibernatePersistenceProvider'
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.getPersistenceProviderAdaptor(PersistenceUnitServiceHandler.java:861)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addPuService(PersistenceUnitServiceHandler.java:259)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.handleJarDeployment(PersistenceUnitServiceHandler.java:153)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:128)
at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
... 5 more

16:38:51,354 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "foo_all.ear")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"foo_all.ear\".\"foo_sb.jar\".FIRST_MODULE_USE" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"foo_all.ear\".\"foo_sb.jar\".FIRST_MODULE_USE: JBAS018733: Failed to process phase FIRST_MODULE_USE of subdeployment \"foo_sb.jar\" of deployment \"foo_all.ear\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011445: Failed to get adapter for persistence provider 'de.foo.FooHibernatePersistenceProvider'"}}

可以部署ear文件并启动服务器。但是在创建 ear 文件之后,必须在主部署的根目录中部署一个子部署。

持久性 xml 如下所示:

   <?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_1.xsd"
version="2.1">
<persistence-unit name="foo">
<provider>de.foo.srv.persistenceprovider.fooHibernatePersistenceProvider</provider>
<jta-data-source>java:/foo</jta-data-source>
<jar-file>foo_sb.jar</jar-file>
<properties>
<property name="jboss.as.jpa.adapterModule" value="org.jboss.as.jpa.hibernate:4" />
</properties>
</persistence-unit>
</persistence>

我已经安装了 ojdbc7.jar 并测试了连接。所需的 Jar 已在 JBoss 7 中连接。这在 JBoss 7 中运行良好。我不知道为什么它不适用于 Wildfly。

请帮忙!

最佳答案

我删除了 hibernate 属性并且它起作用了。

<property name="jboss.as.jpa.adapterModule" value="org.jboss.as.jpa.hibernate:4" />

关于java - JBAS011445 : Failed to get adapter for persistence provider using WildFly,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30871339/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com