Wsimport fails during Maven build
Asked Answered
U

3

7

I'm trying to use wsimport to generate classes from a WSDL.

I'm using the Maven POP generated by Netbeans (7.1) but I get the following output when I attempt to build it:

[jaxws:wsimport]
Processing: C:\Users\...\src\wsdl\ShipService_v5.wsdl
jaxws:wsimport args: [-s, C:\Users\...\target\generated-sources\jaxws-wsimport, -d, C:\Users\...\target\classes, -verbose, -catalog, C:\Users\...\src\jax-ws-catalog.xml, -wsdllocation, file:/C:/Users/.../Desktop/ShipService_v5.wsdl, -extension, -Xnocompile, C:\Users\...\src\wsdl\ShipService_v5.wsdl]
parsing WSDL...

------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.361s
Finished at: Mon Apr 09 12:51:52 BST 2012
Final Memory: 4M/120M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:jaxws-maven-plugin:1.10:wsimport (wsimport-generate-ShipService_v5) on project RPDataStreams: Error executing: wsimport [-s, C:\Users\...\target\generated-sources\jaxws-wsimport, -d, C:\Users\...\target\classes, -verbose, -catalog, C:\Users\...\src\jax-ws-catalog.xml, -wsdllocation, file:/C:/Users/.../Desktop/ShipService_v5.wsdl, -extension, -Xnocompile, C:\Users\...\src\wsdl\ShipService_v5.wsdl] -> [Help 1]

The Plugin section from my POM is:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxws-maven-plugin</artifactId>
    <version>1.10</version>
    <executions>
        <execution>
            <goals>
                <goal>wsimport</goal>
            </goals>
            <configuration>
                <wsdlFiles>
                    <wsdlFile>ShipService_v5.wsdl</wsdlFile>
                </wsdlFiles>
                <wsdlLocation>file:/C:/Users/.../Desktop/ShipService_v5.wsdl</wsdlLocation>
                <staleFile>${project.build.directory}/jaxws/stale/ShipService_v5.stale</staleFile>
            </configuration>
            <id>wsimport-generate-ShipService_v5</id>
            <phase>generate-sources</phase>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>webservices-api</artifactId>
            <version>1.4</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>

I know that there's nothing wrong with the WSDL I'm using, I've also tried it with the WSDL from http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl.

I've tried building this project from Netbeans and on the command line from an Ubuntu server, both times I get the same result.

I've now narrowed this down to the dependency on jconfig. If I Comment out the block below then the web service sources are build successfully.

    <dependency>
        <groupId>org.jconfig</groupId>
        <artifactId>jconfig</artifactId>
        <version>2.9</version>
        <exclusions>
            <exclusion>
                <artifactId>jmxri</artifactId>
                <groupId>com.sun.jmx</groupId>
            </exclusion>
        </exclusions>
    </dependency>

Thanks for the help.

Unexampled answered 9/4, 2012 at 12:28 Comment(3)
run maven with -X - hopefully you'll get more information from the jaxws plugin.Thirzia
The three dots in C:/Users/.../src/ look wrong, or is that some kind of new windows feature?Haemoid
The ... is just to strip out the full path. Running with -X doesn't give any useful information. I've removed the jconfig dependency and replaced it with Commons Configuration (which I think is better anyway) and the project builds now.Unexampled
S
8

You should use:

<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.2</version>

which is the latest version (notice that the plugin got moved to org.jvnet.jax-ws-commons)

Edit:

You could try selectively excluding jconfig build dependencies. The complete list looks like:

<dependency>
    <groupId>org.jconfig</groupId>
    <artifactId>jconfig</artifactId>
    <version>2.9</version>
    <exclusions>
        <exclusion>
            <groupId>com.sun.jmx</groupId>
            <artifactId>jmxri</artifactId>
        </exclusion>
        <exclusion>
            <groupId>javax.xml.parsers</groupId>
            <artifactId>jaxp-api</artifactId>
        </exclusion>
        <exclusion>
            <groupId>crimson</groupId>
            <artifactId>crimson</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Edit: do you actually need jconfig? If not, just get rid of it.

Stylolite answered 9/4, 2012 at 20:8 Comment(2)
I've updated my POM as suggested but I get the same result as previously. Removing the JConfig dependency will allow the project to build.Unexampled
Incrementing the version of jaxws-maven-plugin to 2.2 resolved the same problem for me - thank you.Unrequited
C
3

In the JRE tab of run configuration of your project, select the alternate JRE and add the path of the installed JDK. For me, doing this solved the issue.

Columbous answered 3/12, 2015 at 8:59 Comment(1)
I had this problem running with Java 11 a Java 8 project. May be this version of the plugin is not Java 11 compatible.Isogamy
C
2

You might be using JRE rather than JDK.

Please try changing the JDK and Run again maven build.

Change JRE to JDK - http://www.gamefromscratch.com/post/2011/11/15/Telling-Eclipse-to-use-the-JDK-instead-of-JRE.aspx

Capriccioso answered 21/7, 2015 at 7:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.