Wsimport does not work during Maven build

I am trying to use wsimport to create classes from WSDL.

I am using Maven POP created by Netbeans (7.1), but I get the following output when I try 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] 

My POM plugin section:

 <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 is nothing wrong with the WSDL that I use, I also tried it with WSDL from http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl .

I tried to create this project from Netbeans and on the command line from the Ubuntu server, both times I get the same result.

I have now narrowed this down to jconfig dependency. If I comment on this block below, the web service sources will be successfully generated.

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

+7
source share
3 answers

You should use:

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

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

Edit:

You can try to selectively exclude jconfig dependencies. The full list is as follows:

 <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 really need jconfig? If not, just get rid of it.

+6
source

Perhaps you are using a JRE, not a JDK.

Try changing the JDK and running maven build again.

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

+2
source

On the JRE tab, to start the configuration of your project, select an alternative JRE and add the path to the installed JDK. For me, this solved the problem.

0
source

All Articles