【问题标题】:mvn wildfly-swarm:run errormvn wildfly-swarm:运行错误
【发布时间】:2017-05-17 18:53:03
【问题描述】:

我使用 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]"                                                                                        
    ]                                                                                                                                                                                                                                        
}

我该怎么办? 如果有人可以帮助我,谢谢!

【问题讨论】:

  • 从错误中我猜你添加了 WF Swarm 的 jpa 和/或 datasource 依赖项。您是否还添加了对 H2 JDBC 驱动程序的依赖项,还是添加了其他依赖项?请参阅howto.wildfly-swarm.io/create-a-datasource 了解如何创建数据源连接
  • 是的真的忘了JDBC驱动的依赖了,非常感谢帮助

标签: maven java-ee-7 wildfly-swarm jboss-forge


【解决方案1】:

虽然您没有在帖子中包含您的 persistence.xml,但此错误意味着默认数据库驱动程序未启动,并且在 jpa 使用的您的 persistence.xml 文件中引用了它。如果您使用 Maven,则需要至少包含一个使用编译范围的默认 jdbc 驱动程序 jar,这将自动配置 ExampleDS 数据源。

另外,请确保您使用的是最新的 ws,即 2017.5.0。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-08
    • 2023-03-06
    • 2023-03-18
    • 1970-01-01
    • 1970-01-01
    • 2018-06-15
    • 2021-10-13
    • 1970-01-01
    相关资源
    最近更新 更多