2015-04-27 7 views
2

Я пытаюсь использовать инфраструктуру Ninja с веб-службой .Net, которая предоставляет только SOAP.Maven Web Service WSDL поколение не работает

Я рассмотрел ряд демонстраций, но ничего не работает для моего проекта.

Я не эксперт в Maven или Ninja Framework, поэтому я немного потерял.

Вот результат моей компиляции после того, как netbeans добавили код веб-службы WSDL.

Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport (wsimport-generate-FootballDataDemo.asmx) on project serviceMain: Mojo failed - check output -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport (wsimport-generate-FootballDataDemo.asmx) on project serviceMain: Mojo failed - check output 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) 
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) 
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) 
Caused by: org.apache.maven.plugin.MojoExecutionException: Mojo failed - check output 
    at org.jvnet.jax_ws_commons.jaxws.AbstractJaxwsMojo.exec(AbstractJaxwsMojo.java:393) 
    at org.jvnet.jax_ws_commons.jaxws.WsImportMojo.processLocalWsdlFiles(WsImportMojo.java:319) 
    at org.jvnet.jax_ws_commons.jaxws.WsImportMojo.execute(WsImportMojo.java:283) 
    at org.jvnet.jax_ws_commons.jaxws.MainWsImportMojo.execute(MainWsImportMojo.java:50) 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 
    ... 19 more 


For more information about the errors and possible solutions, please read the following articles: 
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

и вот мой файл pom.

<?xml version="1.0" encoding="UTF-8"?> 
<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> 

    <artifactId>serviceMain</artifactId> 
    <packaging>war</packaging> 
    <groupId>soccerConsumer</groupId> 
    <version>1.0-SNAPSHOT</version> 

    <url>http://www.ninjaframework.org</url> 

    <properties> 
     <ninja.version>5.1.0</ninja.version> 
     <jetty.version>9.2.10.v20150310</jetty.version> 
    </properties> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.2</version> 
       <configuration> 
        <source>1.7</source> 
        <target>1.7</target> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-enforcer-plugin</artifactId> 
       <version>1.3.1</version> 
       <executions> 
        <execution> 
         <id>enforce-banned-dependencies</id> 
         <goals> 
          <goal>enforce</goal> 
         </goals> 
         <configuration> 
          <rules> 
           <bannedDependencies> 
            <excludes> 
             <exclude>commons-logging</exclude> 
            </excludes> 
           </bannedDependencies> 
          </rules> 
          <fail>true</fail> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.eclipse.jetty</groupId> 
       <artifactId>jetty-maven-plugin</artifactId> 
       <version>${jetty.version}</version> 
       <configuration> 
        <contextPath>/</contextPath> 
        <stopKey>stop</stopKey> 
        <stopPort>8889</stopPort> 
        <scanIntervalSeconds>1</scanIntervalSeconds> 
        <reload>automatic</reload> 
        <scanTargetPatterns> 
         <scanTargetPattern> 
          <directory>target/classes</directory> 
          <includes> 
           <include>**/*</include> 
          </includes> 
          <excludes> 
           <exclude>**/*.ftl.html</exclude> 
           <exclude>assets/**</exclude> 
          </excludes> 
         </scanTargetPattern> 
        </scanTargetPatterns> 
        <systemProperties> 
         <systemProperty> 
          <name>ninja.mode</name> 
          <value>dev</value> 
         </systemProperty> 
        </systemProperties> 
       </configuration> 
      </plugin> 
      <!-- Allows you to run Ninja via the SuperDevMode. --> 
      <!-- run "mvn ninja:run" on the command line for the best --> 
      <!-- development experience. --> 
      <plugin> 
       <groupId>org.ninjaframework</groupId> 
       <artifactId>ninja-maven-plugin</artifactId> 
       <version>${ninja.version}</version> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-deploy-plugin</artifactId> 
       <version>2.8.2</version> 
       <configuration> 
        <skip>true</skip> 
       </configuration> 
      </plugin> 
      <plugin> 
       <artifactId>maven-assembly-plugin</artifactId> 
       <version>2.5</version> 
       <configuration> 
        <descriptorRefs> 
         <descriptorRef>jar-with-dependencies</descriptorRef> 
        </descriptorRefs> 
        <archive> 
         <manifest> 
          <mainClass>ninja.standalone.NinjaJetty</mainClass> 
         </manifest> 
        </archive> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.jvnet.jax-ws-commons</groupId> 
       <artifactId>jaxws-maven-plugin</artifactId> 
       <version>2.3</version> 
       <executions> 
        <execution> 
         <goals> 
          <goal>wsimport</goal> 
         </goals> 
         <configuration> 
          <wsdlFiles> 
           <wsdlFile>www.xmlsoccer.com/FootballDataDemo.asmx.wsdl</wsdlFile> 
          </wsdlFiles> 
          <packageName>serviceDemo</packageName> 
          <wsdlLocation>http://www.xmlsoccer.com/FootballDataDemo.asmx?wsdl</wsdlLocation> 
          <staleFile>${project.build.directory}/jaxws/stale/FootballDataDemo.asmx.stale</staleFile> 
         </configuration> 
         <id>wsimport-generate-FootballDataDemo.asmx</id> 
         <phase>generate-sources</phase> 
        </execution> 
       </executions> 
       <dependencies> 
        <dependency> 
         <groupId>javax.xml</groupId> 
         <artifactId>webservices-api</artifactId> 
         <version>2.0</version> 
        </dependency> 
       </dependencies> 
       <configuration> 
        <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir> 
        <xnocompile>true</xnocompile> 
        <verbose>true</verbose> 
        <extension>true</extension> 
        <catalog>${basedir}/src/jax-ws-catalog.xml</catalog> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-war-plugin</artifactId> 
       <version>2.0.2</version> 
       <configuration> 
        <webResources> 
         <resource> 
          <directory>src</directory> 
          <targetPath>WEB-INF</targetPath> 
          <includes> 
           <include>jax-ws-catalog.xml</include> 
           <include>wsdl/**</include> 
          </includes> 
         </resource> 
        </webResources> 
       </configuration> 
      </plugin> 
     </plugins> 
     <resources> 
      <resource> 
       <directory>src/main/java</directory> 
       <includes> 
        <include>**/*</include> 
       </includes> 
       <excludes> 
        <exclude>**/*.java</exclude> 
       </excludes> 
      </resource> 
      <resource> 
       <directory>src/main/resources</directory> 
       <includes> 
        <include>**/*</include> 
       </includes> 
      </resource> 
     </resources> 
    </build> 
    <dependencies> 
     <dependency> 
      <groupId>org.webjars</groupId> 
      <artifactId>tinymce-jquery</artifactId> 
      <version>4.0.16</version> 
     </dependency> 
     <dependency> 
      <groupId>org.webjars</groupId> 
      <artifactId>bootstrap</artifactId> 
      <version>3.3.2</version> 
     </dependency> 
     <dependency> 
      <groupId>org.webjars</groupId> 
      <artifactId>jquery</artifactId> 
      <version>2.1.3</version> 
     </dependency>   
     <dependency> 
      <groupId>com.h2database</groupId> 
      <artifactId>h2</artifactId> 
      <version>1.4.182</version> 
     </dependency> 
     <!-- If you want to deploy to a war please --> 
     <!-- comment ninja-standalone dependency and --> 
     <!-- uncomment the dependency for ninja-servlet --> 
     <!-- 
     <dependency> 
      <groupId>org.ninjaframework</groupId> 
      <artifactId>ninja-servlet</artifactId> 
      <version>${ninja.version}</version> 
     </dependency> 
     --> 
     <dependency> 
      <groupId>org.ninjaframework</groupId> 
      <artifactId>ninja-standalone</artifactId> 
      <version>${ninja.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.ninjaframework</groupId> 
      <artifactId>ninja-test-utilities</artifactId> 
      <version>${ninja.version}</version> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 
</project> 

Это Ниндзя по умолчанию проект прямой из документации ниндзя, с добавлением дополнительного веб-службы с помощью NetBeans.

Как только веб-сервис будет добавлен, он больше не будет компилироваться.

ответ

4

У меня была такая же проблема в моем проекте.

Проблема заключалась в том, что путь к папке проекта были пробелы, например:

/somepath/school/My Projects/project 

Если это дело для вас, а также, попробуйте переименовать папки так что они не имеют каких-либо пробелов.

+0

У меня такая же ошибка, но нет места на моем пути – baraber

+1

@baraber, в моем случае проблема заключалась в том, что я пытался построить JDK8. Переход на JDK 7 и понижение Maven для совместимости с ним, работали как шарм. – cristianorbs

+0

@cristianorbs Спасибо за указание. Это имеет смысл. Теперь я добавлю, что он работает для меня в java 8, предоставляя мне правильный плагин компилятора в полях. Невозможно скомпилировать с jdk8 для цели 1.7. Это была проблема для меня. – baraber