title: Jaxb Xew Plugin in Maven JAX WS
body: <pre><code>mvn generate-sources
  [INFO] Scanning for projects...
  [INFO]
  [INFO] Using the builder          org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBu
  ilder with a thread count of 1
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building epay_api 0.0.1-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] --- jaxws-maven-plugin:2.3:wsimport (wsimport-generate-sources) @ api ---
  [INFO] Processing: file:/C:/service.wsdl
  [WARNING] Using platform encoding (Cp1256), build is platform dependent!
  [INFO] jaxws:wsimport args: [-keep, -s, C:\api\src\main\java, -d, C:\api\target\classes,     -verbose, -Xnocompile, -B-debug, -B-no-header, -B-Xxew, -B-Xx
  ew:instantiate lazy, -B-Xxew:delete, -B-extension, -B-b C:\api/src/main/res
  ources/jaxb_binding.xml, "file:/C:/api/src/main/resources/service.w
  sdl"]
  [DEBUG] JAXB Compilation started (XmlElementWrapperPlugin.onActivated):
  [DEBUG]   buildId         : 2.2.7
  [DEBUG]   targetDir       : .
  [DEBUG]   defaultPackage  : null
  [DEBUG]   defaultPackage2 : null
  [DEBUG]   debug           : true
  [DEBUG]   verbose         : true
  [DEBUG]   quiet           : false
  [DEBUG]   grammars        : 0
  [DEBUG] Argument[0] = -Xxew
  [DEBUG] Argument[0] = -Xxew:instantiate
  [DEBUG] Argument[0] = -Xxew:delete
  parsing WSDL...
  
  
  Exception in thread "main" java.lang.ClassCastException: java.lang.NoSuchMethodError     cannot be cast
  to java.lang.Exception
          at org.jvnet.jax_ws_commons.jaxws.Invoker.main(Invoker.java:87)
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 2.593 s
  [INFO] Finished at: 2014-04-04T04:06:54+04:00
  [INFO] Final Memory: 7M/216M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport     (wsimport-ge
  nerate-sources) on project epay_api: Mojo failed - check output -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the     following arti
  cles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p>Here is my simple pom.xml</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;api&lt;/groupId&gt;
  &lt;artifactId&gt;api&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  
  &lt;build&gt;
  
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.jvnet.jax-ws-commons&lt;/groupId&gt;
              &lt;artifactId&gt;jaxws-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;wsimport-generate-sources&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;wsimport&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;verbose&gt;true&lt;/verbose&gt;
                          &lt;sourceDestDir&gt;src/main/java&lt;/sourceDestDir&gt;
                          &lt;wsdlDirectory&gt;src/main/resources/&lt;/wsdlDirectory&gt;
                          &lt;wsdlLocation&gt;src/main/resources/*&lt;/wsdlLocation&gt;
                          &lt;xjcArgs&gt;
                              &lt;xjcArg&gt;-debug&lt;/xjcArg&gt;
                              &lt;xjcArg&gt;-no-header&lt;/xjcArg&gt;
  
                              &lt;xjcArg&gt;-Xxew&lt;/xjcArg&gt;
                              &lt;xjcArg&gt;-Xxew:instantiate lazy&lt;/xjcArg&gt;
                              &lt;xjcArg&gt;-Xxew:delete&lt;/xjcArg&gt;
  
                              &lt;xjcArg&gt;-extension&lt;/xjcArg&gt;
                              &lt;xjcArg&gt;-b ${basedir}/src/main/resources/jaxb_binding.xml&lt;/xjcArg&gt;
                              &lt;xjcArg&gt;-XJsr303Annotations&lt;/xjcArg&gt;
                              &lt;!-- &lt;xjcArg&gt;-Xfluent-api&lt;/xjcArg&gt; --&gt;
                              &lt;!-- &lt;xjcArg&gt;-Xvalue-constructor&lt;/xjcArg&gt; --&gt;
                          &lt;/xjcArgs&gt;
  
                      &lt;/configuration&gt;
  
  
                  &lt;/execution&gt;
  
              &lt;/executions&gt;
              &lt;dependencies&gt; 
                  &lt;dependency&gt;
                      &lt;groupId&gt;com.github.jaxb-xew-plugin&lt;/groupId&gt;
                      &lt;artifactId&gt;jaxb-xew-plugin&lt;/artifactId&gt;
                      &lt;version&gt;1.2&lt;/version&gt;
                  &lt;/dependency&gt;
  
                  &lt;dependency&gt;
                      &lt;groupId&gt;com.github.krasa&lt;/groupId&gt;
                      &lt;artifactId&gt;krasa-jaxb-tools&lt;/artifactId&gt;
                      &lt;version&gt;1.1&lt;/version&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
          &lt;/plugin&gt;
  
      &lt;/plugins&gt;
  
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>And -e -X switch does not reveal anything about this error</p>
  
  <p>"main" java.lang.ClassCastException: java.lang.NoSuchMethodError cannot be cast
  on
  .jax_ws_commons.jaxws.Invoker.main(Invoker.java:87)</p>
  
  <p>This is the most basic configuration i am trying.</p>
  
  <p>C:\api>java -version
  java version "1.7.0_51"
  Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
  Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)</p>
  
  <p>C:\api>mvn -version
  Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T21:37:52+04:00)
  Maven home: C:\Program Files\apache-maven-3.2.1\bin..
  Java version: 1.7.0_51, vendor: Oracle Corporation
  Java home: C:\Program Files\Java\jdk1.7.0_51\jre
  Default locale: en_US, platform encoding: Cp1256
  OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"</p>
  
  <p>What is wrong with my configuration? Appreciate any help thanks</p>