我有一个包含EJB应用程序,WebApp和客户端jar的EAR应用程序。
我在WildFly中创建了数据源,名称如下:
java:jboss/datasources/NersTspDS
java:jboss/datasources/NersDS
java:jboss/datasources/NersMgtDS
在部署应用程序时,我收到以下错误
Wildfly日志中的错误:
[org.jboss.as.controller.management-operation] (XNIO-1 task-10) WFLYCTL0013: Operation ("add") failed - address: ([{"deployment" => "NERSServer-1.0.ear"}]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.persistenceunit.\"NERSServer-1.0.ear/DBServer-1.0.jar#NersTspDS\" is missing [jboss.naming.context.java.jboss.datasources.NersTspDS]",
"jboss.deployment.unit.\"NERSServer-1.0.ear\".deploymentCompleteService is missing [jboss.deployment.subunit.\"NERSServer-1.0.ear\".\"WebServer-1.0.war\".deploymentCompleteService]",
"jboss.persistenceunit.\"NERSServer-1.0.ear/DBServer-1.0.jar#NersMgtDS\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.NersMgtDS]",
"jboss.persistenceunit.\"NERSServer-1.0.ear/WebServer-1.0.war#NersMgtDS\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.NersMgtDS]",
"jboss.persistenceunit.\"NERSServer-1.0.ear/WebServer-1.0.war#NersDS\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.NersDS]",
"jboss.persistenceunit.\"NERSServer-1.0.ear/DBServer-1.0.jar#NersDS\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.NersDS]",
"jboss.persistenceunit.\"NERSServer-1.0.ear/DBServer-1.0.jar#NersTspDS\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.NersTspDS]",
"jboss.persistenceunit.\"NERSServer-1.0.ear/DBServer-1.0.jar#NersMgtDS\" is missing [jboss.naming.context.java.jboss.datasources.NersMgtDS]",
"jboss.deployment.subunit.\"NERSServer-1.0.ear\".\"WebServer-1.0.war\".weld.weldClassIntrospector is missing [jboss.deployment.subunit.\"NERSServer-1.0.ear\".\"WebServer-1.0.war\".beanmanager]",
"jboss.persistenceunit.\"NERSServer-1.0.ear/WebServer-1.0.war#NersTspDS\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.NersTspDS]",
"jboss.deployment.subunit.\"NERSServer-1.0.ear\".\"DBServer-1.0.jar\".component.LoginBean.START is missing [jboss.persistenceunit.\"NERSServer-1.0.ear/WebServer-1.0.war#NersDS\", jboss.persistenceunit.\"NERSServer-1.0.ear/WebServer-1.0.war#NersMgtDS\", jboss.persistenceunit.\"NERSServer-1.0.ear/WebServer-1.0.war#NersTspDS\"]",
"jboss.persistenceunit.\"NERSServer-1.0.ear/DBServer-1.0.jar#NersDS\" is missing [jboss.naming.context.java.jboss.datasources.NersDS]",
"jboss.deployment.subunit.\"NERSServer-1.0.ear\".\"WebServer-1.0.war\".batch.environment is missing [jboss.deployment.subunit.\"NERSServer-1.0.ear\".\"WebServer-1.0.war\".bea
答案 0 :(得分:0)
错误是因为我在应用程序的persistence.xml中使用了多个数据源,我需要启用该属性以允许WildFly的Standalone.sh文件中的多个数据源。添加此属性后,错误消失了。