2017-02-28 123 views
0

做“mvn wildfly:deploy”时遇到麻烦,我很难做“mvn wildfly:deploy”。 以下是错误代码:在使用wildfly 10.1.0.Final,hibernate ogm 5.0.10.Final和Cassandra 3.0.9

[错误]未能执行目标org.wildfly.plugins:wildfly - Maven的插件:1.1.0.Final:部署(默认CLI)项目aigateway:无法执行目标部署:{“WFLYCTL0062:复合操作失败并被回滚。失败的步骤:”=> {“Operation step-1”=> {“WFLYCTL0080:Failed services”=> {“jboss.module.service。\ “deployment.aigateway.war”。main:=>“service jboss.module.service。\”deployment.aigateway.war \“中的org.jboss.msc.service.StartException。main:WFLYSRV0179:加载模块失败: deployment.aigateway.war:main [ERROR]引起:org.jboss.modules.ModuleNotFoundException:org.hibernate:ogm“},”WFLYCTL0412:未安装的必需服务:“=> [”jboss.module.service \“deployment.aigateway.war \”主” ],“WFLYCTL0180:缺失/不可用依赖项的服务”=>未定义}}} [错误] - > [帮助1] [错误] [错误]要查看错误的完整堆栈跟踪,与-e开关。 [错误]使用-X开关重新运行Maven以启用完整的调试日志记录。 [错误] [错误]有关错误和可能的解决方案的更多信息,请阅读以下条款: [错误] [说明1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

这里是我的pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<groupId>com.sensorhound</groupId> 
<artifactId>aigateway</artifactId> 
<version>0.0.1-SNAPSHOT</version> 
<packaging>war</packaging> 
<name>AI Gateway Maven Webapp</name> 
<url>http://maven.apache.org</url> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <jetty.version>9.3.12.v20160915</jetty.version> 
    <jersey.version>2.23.2</jersey.version> 
    <ogm.version>5.0.10.Final</ogm.version> 
    <hibernate.version>5.0.10.Final</hibernate.version> 
</properties> 

<dependencyManagement> 
    <dependencies> 
     <dependency> 
      <groupId>org.hibernate.ogm</groupId> 
      <artifactId>hibernate-ogm-bom</artifactId> 
      <version>5.0.4.Final</version> 
      <type>pom</type> 
      <scope>import</scope> 
     </dependency> 
    </dependencies> 
</dependencyManagement> 

<dependencies> 
    <!-- hibernate --> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-core</artifactId> 
     <version>${hibernate.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-search-orm</artifactId> 
     <version>5.5.1.Final</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-entitymanager</artifactId> 
     <version>${hibernate.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-search-infinispan</artifactId> 
     <version>5.1.1.Final</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate.ogm</groupId> 
     <artifactId>hibernate-ogm-cassandra</artifactId> 
     <version>5.0.4.Final</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>dom4j</groupId> 
     <artifactId>dom4j</artifactId> 
     <version>1.6.1</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.jboss.logging</groupId> 
     <artifactId>jboss-logging</artifactId> 
     <version>3.3.0.Final</version> 
    </dependency> 

    <!-- hibernate ogm --> 
    <!-- Hibernate OGM Infinispan module; pulls in the OGM core module --> 
    <dependency> 
     <groupId>org.hibernate.ogm</groupId> 
     <artifactId>hibernate-ogm-infinispan</artifactId> 
    </dependency> 
    <!-- standard APIs dependencies - provided in a Java EE container --> 
    <dependency> 
     <groupId>org.hibernate.javax.persistence</groupId> 
     <artifactId>hibernate-jpa-2.1-api</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.jboss.spec.javax.transaction</groupId> 
     <artifactId>jboss-transaction-api_1.2_spec</artifactId> 
    </dependency> 
    <!-- Add the Narayana Transactions Manager 
    an implementation would be provided in a Java EE container, 
    but this works nicely in Java SE as well --> 
    <dependency> 
     <groupId>org.jboss.narayana.jta</groupId> 
     <artifactId>narayana-jta</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.jboss</groupId> 
     <artifactId>jboss-transaction-spi</artifactId> 
     <version>7.5.0.Final</version> 
    </dependency> 
    <dependency> 
     <groupId>jboss</groupId> 
     <artifactId>jbossjta</artifactId> 
     <version>4.2.2.GA</version> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.jetty</groupId> 
     <artifactId>jetty-server</artifactId> 
     <version>${jetty.version}</version> 
    </dependency> 
    <!-- dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-servlet</artifactId> 
     <version>${jetty.version}</version> </dependency --> 
    <dependency> 
     <groupId>org.glassfish.jersey.core</groupId> 
     <artifactId>jersey-server</artifactId> 
     <version>${jersey.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.glassfish.jersey.containers</groupId> 
     <artifactId>jersey-container-servlet-core</artifactId> 
     <version>${jersey.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.glassfish.jersey.containers</groupId> 
     <artifactId>jersey-container-jetty-http</artifactId> 
     <version>${jersey.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.fusesource.leveldbjni</groupId> 
     <artifactId>leveldbjni-all</artifactId> 
     <version>1.8</version> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.12</version> 
    </dependency> 
    <!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api --> 
    <dependency> 
     <groupId>javax.ws.rs</groupId> 
     <artifactId>javax.ws.rs-api</artifactId> 
     <version>2.0</version> 
    </dependency> 
    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>javax.servlet-api</artifactId> 
     <version>3.0.1</version> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate.javax.persistence</groupId> 
     <artifactId>hibernate-jpa-2.0-api</artifactId> 
     <version>1.0.1.Final</version> 
    </dependency> 
    <dependency> 
     <groupId>com.googlecode.json-simple</groupId> 
     <artifactId>json-simple</artifactId> 
     <version>1.1.1</version> 
    </dependency> 
    <dependency> 
     <groupId>javax.ejb</groupId> 
     <artifactId>ejb-api</artifactId> 
     <version>3.0</version> 
    </dependency> 
    <dependency> 
     <groupId>javax</groupId> 
     <artifactId>javaee-api</artifactId> 
     <version>7.0</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.google.guava</groupId> 
     <artifactId>guava</artifactId> 
     <version>19.0</version> 
    </dependency> 
</dependencies> 
<build> 
    <finalName>aigateway</finalName> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.1</version> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.wildfly.plugins</groupId> 
      <artifactId>wildfly-maven-plugin</artifactId> 
      <version>1.1.0.Final</version> 
      <configuration> 
      <force>true</force> 
      <hostname>${wildfly-hostname}</hostname> 
      <username>${wildfly-user}</username> 
      <password>${wildfly-password}</password> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

这里是我的persistence.xml:

<?xml version="1.0"?> 
<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_0.xsd" 
     version="2.0"> 

<persistence-unit name="JPAService"> 
    <!-- Use the Hibernate OGM provider: configuration will be transparent --> 
    <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider> 
    <properties> 
     <property name="hibernate.transaction.jta.platform" value="JBossAS" /> 
     <property name="jboss.as.jpa.providerModule" value="org.hibernate:5.2.1.Final" /> 
     <property name="hibernate.ogm.datastore.provider" value="cassandra_experimental"/> 
     <property name="hibernate.ogm.datastore.host" value="127.0.0.1:9042"/> 
     <property name="hibernate.ogm.datastore.database" value="dev"/>   
    </properties> 
</persistence-unit> 

这里是我的JBoss部署-structure.xml:

<jboss-deployment-structure> 
<deployment> 
    <dependencies> 
     <module name="org.hibernate" slot="ogm" services="export" /> 
     <module name="org.hibernate.ogm.cassandra" slot="main" services="export" /> 
    </dependencies> 
</deployment> 

我有休眠OGM所需模块: $ WILDFLY_HOME /模块/系统/层/基/ org/hibernate/

所以我觉得wildfly应该能够找到它。但是当我想部署我的项目时,它给了我那种moduleNutFoundException,我d不知道为什么。有人请帮助我。

谢谢!

回答

0

更换

<module name="org.hibernate" slot="ogm" services="export" /> 

有:

<module name="org.hibernate.ogm" slot="5.0" services="export" /> 

此外,您还需要使用ORM 5.0 OGM 5.0,ORM 5.2.x将无法正常工作。

0

我已经解决了这个问题。

欲了解更多信息,请上网: https://developer.jboss.org/thread/274171

+0

以供将来参考,我认为,如果你接受了答案,有人还要好给你,而不是创建一个新的链接到同一个答案在不同的地方。您可以随时在下面添加评论。否则,你没有给予帮助你的人点数。 – Davide

相关问题