Wsimport fails during Maven build
Solution 1
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.
Solution 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
Solution 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.
jebbench
Updated on December 03, 2020Comments
-
jebbench over 3 years
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.