Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting cxf-codegen-plugin working on Java 9

I've been trying to get cxf-codegen-plugin working on Java 9 with some resistance. So far I've added java.se.ee to the runtime modules and added the necessary dependencies to maven.

However, when I try to build my sources I get the following error:

DefaultValidationEventHandler: [ERROR]: unexpected element (uri:"http://cxf.apache.org/tools/plugin", local:"databinding"). Expected elements are <{}databinding>,<{}frontend> 
 Location:  node: [databinding: null]
apr. 21, 2018 8:23:57 EM org.apache.cxf.tools.wsdlto.core.PluginLoader loadPlugin
ALLVARLIG: Tools plugin jar:file:/C:/Users/Daniel/.m2/repository/org/apache/cxf/cxf-tools-wsdlto-core/3.2.4/cxf-tools-wsdlto-core-3.2.4.jar!/META-INF/tools-plugin.xml load failed

Any ideas what might be causing this or how to fix it?

like image 419
Daniel Skogquist Åborg Avatar asked Apr 21 '18 18:04

Daniel Skogquist Åborg


People also ask

What is CXF codegen plugin?

CXF includes a Maven plugin which can generate java artifacts from WSDL. Here is a simple example: < plugin > < groupId >org.apache.cxf</ groupId > < artifactId >cxf-codegen-plugin</ artifactId >

Which CXF plugin can be used to generate the Java stubs?

There are many ways to generate Java classes from WSDL files – one of them is using the cxf-codegen-plugin, which comes from the Apache Maven CXF.

What is codegen plugin?

hykes. Compatible with IntelliJ IDEA (Ultimate, Community, Educational), WebStorm. GitHub | Issues | JetBrains. This plugin helps you to generate specific template code by create table statement or database .

How do I generate a class from WSDL using Apache CXF?

You will have to make sure that you create an appropriate directory structure for your project and add the earlier shown hello. wsdl file to the specified folder. The wsdl2java plugin will compile this wsdl and create Apache CXF classes in a pre-defined folder.


1 Answers

Run into the same issue, I ended up changing the plugin configuration and adding the required modules explicitly:

 <plugin>
     <groupId>org.apache.cxf</groupId>
     <artifactId>cxf-codegen-plugin</artifactId>
     <version>3.2.4</version>
     <configuration>
         <additionalJvmArgs>--add-modules java.xml.bind,java.xml.ws</additionalJvmArgs>
         <fork>once</fork>
     </configuration>
 </plugin>

It seems to work for Java 9/10 but certainly not going to work for Java 11.

like image 121
reta Avatar answered Sep 30 '22 23:09

reta