我使用jboss forge创建了一个wildfly-swarm测试项目,但是当我生成项目时遇到错误:
2017-05-17 15:35:00,528 ERROR [org.jboss.as.controller.management-operation] (main) WFLYCTL0013: Operation ("add") failed - address: (("deployment" => "demo.war")) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.datasources.ExampleDS"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.persistenceunit.\"demo.war#demo-persistence-unit\" is missing [jboss.naming.context.java.jboss.datasources.ExampleDS]",
"jboss.persistenceunit.\"demo.war#demo-persistence-unit\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.ExampleDS]"
]
}
2017-05-17 15:35:00,530 ERROR [org.jboss.as.server] (main) WFLYSRV0021: Deploy of deployment "demo.war" was rolled back with the following failure message:
{
"WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.datasources.ExampleDS"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.persistenceunit.\"demo.war#demo-persistence-unit\" is missing [jboss.naming.context.java.jboss.datasources.ExampleDS]",
"jboss.persistenceunit.\"demo.war#demo-persistence-unit\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.ExampleDS]"
]
}
我该怎么办? 如果有人可以帮助我,谢谢你!
答案 0 :(得分:0)
虽然您没有在帖子中包含persistence.xml,但此错误意味着未启动默认数据库驱动程序,并且它在jpa使用的persistence.xml文件中引用。如果您正在使用Maven,则需要使用编译范围至少包含一个默认的jdbc驱动程序jar,它将自动配置ExampleDS数据源。
另外,请确保您使用的是2017.5.0的最新版本。