Я пытаюсь сгенерировать несколько классов, используя Maven и Apache CXF. Когда я запускаю maven clean install, я получаю сообщение об ошибке:
[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.<init>(PluginLoader.java:73)
at org.apache.cxf.tools.wsdlto.core.PluginLoader.newInstance(PluginLoader.java:106)
at org.apache.cxf.tools.wsdlto.WSDLToJava.<init>(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; -> [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.<init>(PluginLoader.java:73)
at org.apache.cxf.tools.wsdlto.core.PluginLoader.newInstance(PluginLoader.java:106)
at org.apache.cxf.tools.wsdlto.WSDLToJava.<init>(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
Я использовал тот же POM-файл, и он работал около месяца назад, но я решил почистить папку своего репозитория вчера и попытался запустить его снова, и я получил это сейчас. Мой файл POM выглядит так:
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>ALLXSDSchemaFiles</groupId>
<artifactId>ALLXSDSchemaFiles</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.2.4</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.2.4</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-security</artifactId>
<version>3.2.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-core -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-core</artifactId>
<version>2.7.18</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl -->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-xjc -->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.cxf.xjc-utils/cxf-xjc-runtime -->
<dependency>
<groupId>org.apache.cxf.xjc-utils</groupId>
<artifactId>cxf-xjc-runtime</artifactId>
<version>3.2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.woodstox/stax2-api -->
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>stax2-api</artifactId>
<version>4.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.woodstox/woodstox-core-asl -->
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<version>4.4.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-sources-1</id>
<phase>generate-sources</phase>
<configuration>
<bindingDirectory>${project.basedir}/src/main/resources/XSDFiles</bindingDirectory>
<bindingIncludes>
<include>${project.basedir}/src/main/resources/XSDFiles/jaxb_binding_general.xml</include>
</bindingIncludes>
<sourceRoot>${project.basedir}/src/main/java/</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${project.basedir}/src/main/resources/XSDFiles/SDCConfig.wsdl</wsdl>
<extraargs>
<extraarg>-verbose</extraarg>
<extraarg>-impl</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
<execution>
<id>generate-sources-2</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.basedir}/src/main/java/</sourceRoot>
<bindingDirectory>${project.basedir}/src/main/resources/XSDFiles</bindingDirectory>
<bindingIncludes>
<include>${project.basedir}/src/main/resources/XSDFiles/jaxb_binding_nc3.xml</include>
</bindingIncludes>
<wsdlOptions>
<wsdlOption>
<wsdl>${project.basedir}/src/main/resources/XSDFiles/msip.wsdl</wsdl>
<extraargs>
<extraarg>-verbose</extraarg>
<extraarg>-impl</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Я думаю, что перепутал файлы переплета, но я не уверен, хотя.