Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven mvn wildfly swarm:运行错误_Maven_Java Ee 7_Wildfly Swarm_Jboss Forge - Fatal编程技术网

Maven mvn wildfly swarm:运行错误

Maven mvn wildfly swarm:运行错误,maven,java-ee-7,wildfly-swarm,jboss-forge,Maven,Java Ee 7,Wildfly Swarm,Jboss Forge,我使用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: { "WF

我使用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]"                                                                                        
    ]                                                                                                                                                                                                                                        
}
我该怎么办?
如果有人能帮助我,谢谢

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


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

根据错误,我猜您添加了WF Swarm的
jpa
和/或
datasource
依赖项。您是否还添加了对H2 JDBC驱动程序的依赖项,还是其他的依赖项?有关如何创建数据源连接的信息,请参阅。如果您真的忘记了JDBC驱动程序的依赖性,非常感谢您的帮助