javamavenwsimport

jaxws-maven-plugin fail to run wsimport (ErrorListener)


I am stuck since yesterday on this problem. I am using Maven 2 on Windows:

Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)

And in my POM I use the plugin jaxws-maven-plugin as this:

    <plugin>
        <groupId>org.jvnet.jax-ws-commons</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <version>2.2</version>
        <executions>
            <execution>
                <goals>
                    <goal>wsimport</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <wsdlFiles>
                <wsdlFile>${basedir}/src/main/resources/MyService.wsdl
                </wsdlFile>
            </wsdlFiles>
            <packageName>my.package.name</packageName>
        </configuration>
    </plugin>

When I run mvn compile I get the following error :

[INFO] jaxws:wsimport args: [-keep, -s, D:\myService\target\generated-sources\wsimport, -Xnocompile, -p, my.service.name, file:/D:/myService/src/main/resources/MyService.wsdl]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing: wsimport [-keep, -s, D:\myService\target\generated-sources\wsimport, -Xnocompile, -p, my.service.name, file:/D:/myService/src/main/resources/MyService.wsdl]

Embedded error: com/sun/tools/xjc/api/ErrorListener
com.sun.tools.xjc.api.ErrorListener

I tried :

So anyone knows what could mean:

Embedded error: com/sun/tools/xjc/api/ErrorListener

com.sun.tools.xjc.api.ErrorListener

Solution

  • Adding verbose logging for Maven helped me: mvn -X compile.

    I had in fact a :

    Caused by: java.lang.NoClassDefFoundError: com/sun/tools/xjc/api/ErrorListener
            at java.lang.ClassLoader.defineClass1(Native Method)
    

    It is because one of my dependencies is not in the classpath.