Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven Web Service WSDL generation not working

I am trying to use Ninja framework with a .Net web service that only provides SOAP.

I have looked at a number of demonstrations of it, but nothing seems to be functioning for my project.

I am not an expert int Maven or Ninja Framework so I am at a bit of a loss.

Here is the output from my compile after having netbeans add the WSDL web service code.

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

and here is my pom file.

<?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>

This is a default ninja project straight from the ninja documentation, with the additional web service added using netbeans.

As soon as the webservice is added, it will no longer compile.

like image 367
The Lazy Coder Avatar asked Oct 21 '25 15:10

The Lazy Coder


1 Answers

I had the exact same problem in my project.

The problem was that the path to the project folder had spaces, like so:

/somepath/school/My Projects/project

If this is the case for you as well, try renaming your folders so they doesn't have any spaces.

like image 105
anders Avatar answered Oct 23 '25 03:10

anders



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!