简体   繁体   中英

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

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.

Same here and same error. I am trying to get Axis2 1.8.0 to generate Xmlbeans using Xmlbeans 5.0.2 (current latest version) which I am using elsewhere in my project already. I can see Axis2 generating code with the adb method rather than xmlbeans, but it doesn't seem to generate the xxxDocument classes that my existing code needs and which was generated with the 1.6.3 version of Axis2 previously.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM