title: Apache CXF and Maven java.lang.NoSuchMethodError:
body: <p>I am trying to generate a few classes using Maven and Apache CXF. When i run maven clean install, I get the error as:</p>
  
  <pre><code>[DEBUG]   (f) wsdlRoot = C:\Workspace\SDC\ALLXSDSchemaFiles\src\main\resources\wsdl
  [DEBUG] -- end configuration --
  [INFO] Using proxy server configured in maven.
  [DEBUG] Classpath: [file:/C:/Workspace/SDC/ALLXSDSchemaFiles/target/classes/, file:/C:/Workspace/SDC/ALLXSDSchemaFiles/target/classes/]
  [DEBUG] Calling wsdl2java with args: [-d, C:\Workspace\SDC\ALLXSDSchemaFiles\src\main\java, -verbose, -impl, file:/C:/Workspace/SDC/ALLXSDSchemaFiles/src/main/resources/XSDFiles/SAPConfig.wsdl]
  [DEBUG]
  java.lang.NoSuchMethodError: org.apache.cxf.common.jaxb.JAXBUtils.unmarshall(Ljavax/xml/bind/JAXBContext;Lorg/w3c/dom/Element;Ljava/lang/Class;)Ljavax/xml/bind/JAXBElement;
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.getPlugin(PluginLoader.java:237)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.getPlugin(PluginLoader.java:194)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.loadPlugin(PluginLoader.java:122)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.loadPlugins(PluginLoader.java:102)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.init(PluginLoader.java:79)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.&lt;init&gt;(PluginLoader.java:73)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.newInstance(PluginLoader.java:106)
          at org.apache.cxf.tools.wsdlto.WSDLToJava.&lt;init&gt;(WSDLToJava.java:48)
          at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:414)
          at org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:279)
          at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:511)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 3.135 s
  [INFO] Finished at: 2018-05-07T09:24:58-05:00
  [INFO] Final Memory: 15M/207M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.2.4:wsdl2java (generate-sources-1) on project ALLXSDSchemaFiles: org.apache.cxf.common.jaxb.JAXBUtils.unmarshall(Ljavax/xml/bind/JAXBContext;Lorg/w3c/dom/Element;Ljava/lang/Class;)Ljavax/xml/bind/JAXBElement; -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.2.4:wsdl2java (generate-sources-1) on project ALLXSDSchemaFiles: org.apache.cxf.common.jaxb.JAXBUtils.unmarshall(Ljavax/xml/bind/JAXBContext;Lorg/w3c/dom/Element;Ljava/lang/Class;)Ljavax/xml/bind/JAXBElement;
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: org.apache.maven.plugin.MojoExecutionException: org.apache.cxf.common.jaxb.JAXBUtils.unmarshall(Ljavax/xml/bind/JAXBContext;Lorg/w3c/dom/Element;Ljava/lang/Class;)Ljavax/xml/bind/JAXBElement;
          at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:434)
          at org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:279)
          at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:511)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
          ... 20 more
  Caused by: java.lang.NoSuchMethodError: org.apache.cxf.common.jaxb.JAXBUtils.unmarshall(Ljavax/xml/bind/JAXBContext;Lorg/w3c/dom/Element;Ljava/lang/Class;)Ljavax/xml/bind/JAXBElement;
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.getPlugin(PluginLoader.java:237)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.getPlugin(PluginLoader.java:194)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.loadPlugin(PluginLoader.java:122)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.loadPlugins(PluginLoader.java:102)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.init(PluginLoader.java:79)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.&lt;init&gt;(PluginLoader.java:73)
          at org.apache.cxf.tools.wsdlto.core.PluginLoader.newInstance(PluginLoader.java:106)
          at org.apache.cxf.tools.wsdlto.WSDLToJava.&lt;init&gt;(WSDLToJava.java:48)
          at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:414)
          ... 24 more
  [ERROR]
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p>I used the same POM file and it worked about a month ago, but I decided to clean my repository folder yesterday and tried to run it again, and I get this now. My POM file looks like this:</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;ALLXSDSchemaFiles&lt;/groupId&gt;
      &lt;artifactId&gt;ALLXSDSchemaFiles&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.apache.cxf&lt;/groupId&gt;
                  &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.2.4&lt;/version&gt;
  
                  &lt;dependencies&gt;
  
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
                          &lt;artifactId&gt;cxf-rt-transports-http&lt;/artifactId&gt;
                          &lt;version&gt;3.2.4&lt;/version&gt;
                      &lt;/dependency&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
                          &lt;artifactId&gt;cxf-rt-ws-security&lt;/artifactId&gt;
                          &lt;version&gt;3.2.4&lt;/version&gt;
                      &lt;/dependency&gt;
                      &lt;!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-core --&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
                          &lt;artifactId&gt;cxf-rt-core&lt;/artifactId&gt;
                          &lt;version&gt;2.7.18&lt;/version&gt;
                      &lt;/dependency&gt;
                      &lt;!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl --&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;com.sun.xml.bind&lt;/groupId&gt;
                          &lt;artifactId&gt;jaxb-impl&lt;/artifactId&gt;
                          &lt;version&gt;2.3.0&lt;/version&gt;
                      &lt;/dependency&gt;
                      &lt;!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-xjc --&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;com.sun.xml.bind&lt;/groupId&gt;
                          &lt;artifactId&gt;jaxb-xjc&lt;/artifactId&gt;
                          &lt;version&gt;2.3.0&lt;/version&gt;
                      &lt;/dependency&gt;
                      &lt;!-- https://mvnrepository.com/artifact/org.apache.cxf.xjc-utils/cxf-xjc-runtime --&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.apache.cxf.xjc-utils&lt;/groupId&gt;
                          &lt;artifactId&gt;cxf-xjc-runtime&lt;/artifactId&gt;
                          &lt;version&gt;3.2.1&lt;/version&gt;
                      &lt;/dependency&gt;                   
                      &lt;!-- https://mvnrepository.com/artifact/org.codehaus.woodstox/stax2-api --&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.codehaus.woodstox&lt;/groupId&gt;
                          &lt;artifactId&gt;stax2-api&lt;/artifactId&gt;
                          &lt;version&gt;4.1&lt;/version&gt;
                      &lt;/dependency&gt;                   
                      &lt;!-- https://mvnrepository.com/artifact/org.codehaus.woodstox/woodstox-core-asl --&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.codehaus.woodstox&lt;/groupId&gt;
                          &lt;artifactId&gt;woodstox-core-asl&lt;/artifactId&gt;
                          &lt;version&gt;4.4.1&lt;/version&gt;
                      &lt;/dependency&gt;
  
  
  
                  &lt;/dependencies&gt;
  
                  &lt;executions&gt;
  
                      &lt;execution&gt;
                          &lt;id&gt;generate-sources-1&lt;/id&gt;
                          &lt;phase&gt;generate-sources&lt;/phase&gt;
                          &lt;configuration&gt;
                              &lt;bindingDirectory&gt;${project.basedir}/src/main/resources/XSDFiles&lt;/bindingDirectory&gt;
                              &lt;bindingIncludes&gt;
                                  &lt;include&gt;${project.basedir}/src/main/resources/XSDFiles/jaxb_binding_general.xml&lt;/include&gt;
                              &lt;/bindingIncludes&gt;
                              &lt;sourceRoot&gt;${project.basedir}/src/main/java/&lt;/sourceRoot&gt;
                              &lt;wsdlOptions&gt;
                                  &lt;wsdlOption&gt;
                                      &lt;wsdl&gt;${project.basedir}/src/main/resources/XSDFiles/SDCConfig.wsdl&lt;/wsdl&gt;
                                      &lt;extraargs&gt;
                                          &lt;extraarg&gt;-verbose&lt;/extraarg&gt;
                                          &lt;extraarg&gt;-impl&lt;/extraarg&gt;
                                      &lt;/extraargs&gt;
                                  &lt;/wsdlOption&gt;
                              &lt;/wsdlOptions&gt;
                          &lt;/configuration&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;wsdl2java&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
  
                      &lt;execution&gt;
                          &lt;id&gt;generate-sources-2&lt;/id&gt;
                          &lt;phase&gt;generate-sources&lt;/phase&gt;
                          &lt;configuration&gt;
                              &lt;sourceRoot&gt;${project.basedir}/src/main/java/&lt;/sourceRoot&gt;
                              &lt;bindingDirectory&gt;${project.basedir}/src/main/resources/XSDFiles&lt;/bindingDirectory&gt;
                              &lt;bindingIncludes&gt;
                                  &lt;include&gt;${project.basedir}/src/main/resources/XSDFiles/jaxb_binding_nc3.xml&lt;/include&gt;
                              &lt;/bindingIncludes&gt;
                              &lt;wsdlOptions&gt;
                                  &lt;wsdlOption&gt;
                                      &lt;wsdl&gt;${project.basedir}/src/main/resources/XSDFiles/msip.wsdl&lt;/wsdl&gt;
                                      &lt;extraargs&gt;
                                          &lt;extraarg&gt;-verbose&lt;/extraarg&gt;
                                          &lt;extraarg&gt;-impl&lt;/extraarg&gt;
                                      &lt;/extraargs&gt;
                                  &lt;/wsdlOption&gt;
                              &lt;/wsdlOptions&gt;
                          &lt;/configuration&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;wsdl2java&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
  
                  &lt;/executions&gt;
  
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I am thinking i got the binding files mixed up, but I am not sure though.</p>