maven plugin to generate code from wsdl
843833Jul 21 2008 — edited Jul 22 2008Greetings,
I am using jaxws-maven-plugin for generation artefacts by wsdl based on the documentation provided on the following site:
https://jax-ws-commons.dev.java.net/jaxws-maven-plugin/usage.html
But I have not success using this manual. I have the following stack trace of the error when start "mvn -e":
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error executing: wsimport [-s, xxx/java, -d, xxx/classes, -verbose, -p, package, -Xdebug, xxx/xxx.wsdl]
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
...
Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing: wsimport [-s, xxx/java, -d, xxx/classes, -verbose, -p, package, -Xdebug, xxx/xxx.wsdl]
at org.codehaus.mojo.jaxws.WsImportMojo.wsImport(WsImportMojo.java:283)
...
It seems WsImportMojo.java generates exception because of ClassNotFoundException:
try {
final ClassLoader cl = Invoker.createClassLoader(Thread.currentThread().getContextClassLoader());
Class c = cl.loadClass("com.sun.tools.ws.wscompile.WsimportTool");
Object tool = c.getConstructor(OutputStream.class).newInstance(System.out);
String[] ar = args.toArray( new String[args.size()] );
Boolean result = (Boolean)c.getMethod("run", ar.getClass()).invoke(tool, new Object[]{ar});
if ( !result )
{
throw new MojoExecutionException( "Error executing: wsimport " + args );
}
} catch (Exception e) {
throw new MojoExecutionException( "Error executing: wsimport " + args ); // 283 line
}
Because it can't load com.sum.tools.ws.wscompile.WsimportTool. This class should be found in the jaxws-tools-2.1.1.jar and it is loaded by dependencies management.
Could somebody help me how to fix this problem or where to find the solution?
I use Maven 2.0.9 and Java 1.5.0_15.
Also during installing/configuring this plugin I met the following problems:
1. Maven found the pom of the plugin but could not find the jar: jaxws-maven-plugin-1.10.jar. I downloaded it and install manually from: http://download.java.net/maven/2/org/codehaus/mojo/jaxws-maven-plugin/1.10/
2. I didn't find the com.sun.xml.ws jaxws-rt-2.1 at the standard repositories:
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.1</version>
</dependency>
But I found 2.1EA1, also I found 2.1.1 but for group id sun-jaxws.
I tried both but the MojoExecutionException occurred.
I suppose it is not the best place for this post. But I didn't find solutions at the dev.java.net.
Thank you in advance.