#spring-boot #maven #wsdl #cxf-codegen-plugin #java-17
Вопрос:
Я пытаюсь обновить свое приложение maven SpringBoot с помощью последней версии Java 17 и всех зависимостей до последней версии.
cxf-codegen-плагин начал выдавать интересное исключение, которое я на самом деле не понимаю и не могу найти никакого правильного решения для его решения:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.3.12:wsdl2java (generate-endpoint-sources) on project autorefundexporter: Exit code: 1 Command line was: cmd.exe /X /C "C:appsJavax64jdk-17binjava.exe --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xerces.internal.impl.xs=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED -jar C:UsersmeAppDataLocalTempcxf-tmp-18084792511058340769cxf-codegen2773993495141282809.jar C:UsersmeAppDataLocalTempcxf-tmp-18084792511058340769cxf-w2j12014482162652070777args" at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) 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:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:568) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) at org.codehaus.classworlds.Launcher.main (Launcher.java:47) Caused by: org.apache.maven.plugin.MojoExecutionException: Exit code: 1 Command line was: cmd.exe /X /C "C:appsJavax64jdk-17binjava.exe --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xerces.internal.impl.xs=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED -jar C:UsersmeAppDataLocalTempcxf-tmp-18084792511058340769cxf-codegen2773993495141282809.jar C:UsersmeAppDataLocalTempcxf-tmp-18084792511058340769cxf-w2j12014482162652070777args" at org.apache.cxf.maven_plugin.AbstractCodegenMoho.runForked (AbstractCodegenMoho.java:694) at org.apache.cxf.maven_plugin.AbstractCodegenMoho.forkOnce (AbstractCodegenMoho.java:550) at org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute (AbstractCodegenMoho.java:268) at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute (WSDL2JavaMojo.java:501) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) 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:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:568) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Предупреждение Maven также показывает что-то еще:
[WARNING] Caused by: org.xml.sax.SAXParseException; systemId: jar:file:/C:/Users/me/.m2/repository/org/apache/cxf/cxf-tools-common/3.3.12/cxf-tools-common-3.3.12.jar!/org/apache/cxf/tools/common/jaxb/W3CEPRJaxbBinding_jaxb22.xml; lineNumber: 20; columnNumber: 162; Unexpected lt;bindingsgt; appears at line 20 column 162
В рамках этих предупреждений:
[WARNING] Exception in thread "main" org.apache.cxf.tools.common.ToolException: jar:file:/C:/Users/me/.m2/repository/org/apache/cxf/cxf-tools-common/3.3.12/cxf-tools-common-3.3.12.jar!/org/apache/cxf/tools/common/jaxb/W3CEPRJaxbBinding_jaxb22.xml [20,162]: Unexpected lt;bindingsgt; appears at line 20 column 162 [WARNING] [WARNING] at org.apache.cxf.tools.common.ToolErrorListener.throwToolException(ToolErrorListener.java:87) [WARNING] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:158) [WARNING] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:404) [WARNING] at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:105) [WARNING] at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113) [WARNING] at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86) [WARNING] at org.apache.cxf.maven_plugin.wsdl2java.ForkOnceWSDL2Java.main(ForkOnceWSDL2Java.java:51) [WARNING] Caused by: org.xml.sax.SAXParseException; systemId: jar:file:/C:/Users/me/.m2/repository/org/apache/cxf/cxf-tools-common/3.3.12/cxf-tools-common-3.3.12.jar!/org/apache/cxf/tools/common/jaxb/W3CEPRJaxbBinding_jaxb22.xml; lineNumber: 20; columnNumber: 162; Unexpected lt;bindingsgt; appears at line 20 column 162 [WARNING] at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.unexpectedX(NGCCRuntimeEx.java:607) [WARNING] at com.sun.xml.xsom.impl.parser.state.NGCCHandler.unexpectedEnterElement(NGCCHandler.java:165) [WARNING] at com.sun.xml.xsom.impl.parser.state.Schema.enterElement(Schema.java:376) [WARNING] at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.startElement(NGCCRuntime.java:233) [WARNING] at java.xml/org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:539) [WARNING] at com.sun.tools.xjc.util.SubtreeCutter.startElement(SubtreeCutter.java:78) [WARNING] at com.sun.tools.xjc.reader.ExtensionBindingChecker.startElement(ExtensionBindingChecker.java:120) [WARNING] at java.xml/org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:539) [WARNING] at com.sun.tools.xjc.reader.xmlschema.parser.IncorrectNamespaceURIChecker.startElement(IncorrectNamespaceURIChecker.java:98) [WARNING] at java.xml/org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:539) [WARNING] at com.sun.tools.xjc.reader.xmlschema.parser.CustomizationContextChecker.startElement(CustomizationContextChecker.java:163) [WARNING] at java.xml/org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:539) [WARNING] at com.sun.tools.xjc.reader.internalizer.DOMForestScanner$LocationResolver.startElement(DOMForestScanner.java:117) [WARNING] at org.glassfish.jaxb.core.unmarshaller.DOMScanner.visit(DOMScanner.java:214) [WARNING] at org.glassfish.jaxb.core.unmarshaller.DOMScanner.scan(DOMScanner.java:97) [WARNING] at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:62) [WARNING] at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:70) [WARNING] at com.sun.tools.xjc.reader.internalizer.DOMForestParser.parse(DOMForestParser.java:74) [WARNING] at com.sun.tools.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:210) [WARNING] at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:351) [WARNING] at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:98) [WARNING] at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:141) [WARNING] at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:130) [WARNING] at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:475) [WARNING] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:240) [WARNING] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:67) [WARNING] at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:445) [WARNING] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:715) [WARNING] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:259) [WARNING] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:156) [WARNING] ... 5 more
This is how my plugin is configured:
lt;plugingt; lt;groupIdgt;org.apache.cxflt;/groupIdgt; lt;artifactIdgt;cxf-codegen-pluginlt;/artifactIdgt; lt;versiongt;3.4.5lt;/versiongt; lt;executionsgt; lt;executiongt; lt;idgt;generate-endpoint-sourceslt;/idgt; lt;phasegt;generate-sourceslt;/phasegt; lt;configurationgt; lt;sourceRootgt;${basedir}/target/generatedlt;/sourceRootgt; lt;wsdlOptionsgt; lt;wsdlOptiongt; lt;wsdlgt;${basedir}/src/main/resources/wsdl/my.wsdllt;/wsdlgt; lt;extraargsgt; lt;extraarggt;-plt;/extraarggt; lt;extraarggt;com.my.app.generated lt;/extraarggt; lt;/extraargsgt; lt;validategt;nonelt;/validategt; lt;/wsdlOptiongt; lt;/wsdlOptionsgt; lt;/configurationgt; lt;goalsgt; lt;goalgt;wsdl2javalt;/goalgt; lt;/goalsgt; lt;/executiongt; lt;/executionsgt; lt;dependenciesgt; lt;dependencygt; lt;groupIdgt;javax.xml.bindlt;/groupIdgt; lt;artifactIdgt;jaxb-apilt;/artifactIdgt; lt;versiongt;2.3.1lt;/versiongt; lt;/dependencygt; lt;dependencygt; lt;groupIdgt;com.sun.xml.bindlt;/groupIdgt; lt;artifactIdgt;jaxb-impllt;/artifactIdgt; lt;versiongt;3.0.2lt;/versiongt; lt;/dependencygt; lt;dependencygt; lt;groupIdgt;com.sun.xml.bindlt;/groupIdgt; lt;artifactIdgt;jaxb-xjclt;/artifactIdgt; lt;versiongt;3.0.2lt;/versiongt; lt;/dependencygt; lt;dependencygt; lt;groupIdgt;javax.annotationlt;/groupIdgt; lt;artifactIdgt;javax.annotation-apilt;/artifactIdgt; lt;versiongt;1.3.2lt;/versiongt; lt;/dependencygt; lt;dependencygt; lt;groupIdgt;jakarta.xml.bindlt;/groupIdgt; lt;artifactIdgt;jakarta.xml.bind-apilt;/artifactIdgt; lt;versiongt;3.0.1lt;/versiongt; lt;/dependencygt; lt;dependencygt; lt;groupIdgt;jakarta.activationlt;/groupIdgt; lt;artifactIdgt;jakarta.activation-apilt;/artifactIdgt; lt;versiongt;2.0.1lt;/versiongt; lt;/dependencygt; lt;/dependenciesgt; lt;/plugingt;
Понятия не имею, что теперь делать.. Пожалуйста, помогите мне. Спасибо!
Ответ №1:
Проблема заключалась в том, что я добавил зависимости в плагин. После удаления всех зависимостей все работало идеально:
lt;plugingt; lt;groupIdgt;org.apache.cxflt;/groupIdgt; lt;artifactIdgt;cxf-codegen-pluginlt;/artifactIdgt; lt;versiongt;3.4.5lt;/versiongt; lt;executionsgt; lt;executiongt; lt;idgt;generate-endpoint-sourceslt;/idgt; lt;phasegt;generate-sourceslt;/phasegt; lt;configurationgt; lt;sourceRootgt;${basedir}/target/generatedlt;/sourceRootgt; lt;wsdlOptionsgt; lt;wsdlOptiongt; lt;wsdlgt;${basedir}/src/main/resources/wsdl/my.wsdllt;/wsdlgt; lt;extraargsgt; lt;extraarggt;-plt;/extraarggt; lt;extraarggt;com.my.app.generated lt;/extraarggt; lt;/extraargsgt; lt;validategt;nonelt;/validategt; lt;/wsdlOptiongt; lt;/wsdlOptionsgt; lt;/configurationgt; lt;goalsgt; lt;goalgt;wsdl2javalt;/goalgt; lt;/goalsgt; lt;/executiongt; lt;/executionsgt; lt;/plugingt;