Java: Generating Code from WSDL with "ANT" and "AXIS2 1.8.0"

1.2k Views Asked by At

I am trying to generate Java-Code with ant and axis2 1.8.0 from a wsdl(windows 10), but every time i get the following exception:

[java] Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: XMLBeans binding extension not in classpath

[java]     at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:163)
[java]     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:54)     
[java]     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)     
[java] Caused by: java.lang.RuntimeException: XMLBeans binding extension not in classpath     
[java]     at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:90)     
[java]     at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:116)     
[java]     ... 2 more     
[java] Java Result: 1

I've even followed the official instructions from apache and installed XMLBeans: https://xmlbeans.apache.org/documentation/conInstallGuide.html but it still does not work. Someone had the same issues and can help me out.

By the way: When i use axis2 1.7.9 it works fine.

1

There are 1 best solutions below

0
greghmerrill On

Per https://axis.apache.org/axis2/java/core/release-notes/1.8.0.html :

axis2-xmlbeans has been split into axis2-xmlbeans and axis2-xmlbeans-codegen

I faced a similar issue (java.lang.RuntimeException: XMLBeans binding extension not in classpath) and solved it by adding the following to my maven dependencies, as managed by apache ivy:

<dependency org="org.apache.axis2" name="axis2-xmlbeans-codegen" rev="1.8.0" transitive="false" conf="one-jar-lib->default;sources"/>
<dependency org="com.google.googlejavaformat" name="google-java-format" rev="1.13.0" transitive="false" conf="one-jar-lib->default;sources"/>

(In my case, I had to explicitly bring in googlejavaformat since I had transitive dependencies disabled. If you have them enabled, you may not need that line)