I have been attempting to set up Axis2 within Eclipse and have come across an error when trying to generate client code using the Web Service Client wizard in Eclipse by going to New -> Web Services -> Web Service Client.
My current setup is:
- Eclipse 2021-12 (4.22.0)
- Tomcat 9.0.55
- Axis2 1.8.2
- Java 17 (I have swapped to older versions during testing but that hasn't shown any changes)
I have followed the steps outlined by the Apache Foundation and Eclipse.
- Code Generator Wizard Guide for Eclipse Plug-in
- Eclipse plugin installation
- Eclipse WTP Tutorials - Creating Bottom Up Web Service via Apache Axis2
After following the steps outlined in the Eclipse plugin installation, I am unable to find the Axis2 Code Generator Wizards displayed in the Code Generator Wizard Guide for Eclipse Plug-in. I went along with the debugging steps suggested as well which results in the following error:
org.osgi.framework.BundleException: Could not resolve module: org.apache.axis2.eclipse.codegen.plugin [1372] Unresolved requirement: Import-Package: com.google.appengine.api
I had assumed the issue was related to a missing package installation for my Eclipse version. I went to install Google Cloud Tools for Eclipse however this did not fix the issue.
I searched for a while but could not find a solution to this problem and instead found the Eclipse WTP Tutorials - Creating Bottom Up Web Service via Apache Axis2 guide. Following along was going well as I was able to connect Axis2 with Eclipse, create a new project, generate a WSDL from the Java code, deploy the service to an installed Tomcat Server and view the service through localhost.
The next issue came as I attempted to generate a Web Service Client from the produced WSDL web page. I first came across an issue with a missing XmlSchemaForm which I resolved by adding the dependency to my pom.xml file.
The current problem I have is when attempting to generate a Web Service Client, the following error is produced:
Exception occurred during code generation for WSDL : null
java.lang.NoSuchMethodException: org.apache.axis2.wsdl.codegen.CodeGenConfiguration.<init>(java.util.Map)
at java.base/java.lang.Class.getConstructor0(Class.java:3585)
at java.base/java.lang.Class.getConstructor(Class.java:2271)
at org.eclipse.jst.ws.axis2.consumption.core.command.Axis2ClientCodegenCommand.execute(Axis2ClientCodegenCommand.java:157)
As shown, it looks like the missing Code Gen plugin could be the cause. I have included the maven dependencies in my pom.xml:
EDIT: The initial post was not letting me submit the pom.
pom.xml
<dependencies>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>
<version>1.8.2</version>
<type>pom</type>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.axis2/axis2-codegen -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-codegen</artifactId>
<version>1.8.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.axis2/axis2-java2wsdl -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-java2wsdl</artifactId>
<version>1.8.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.mojo/animal-sniffer-annotations -->
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-annotations</artifactId>
<version>1.14</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.axis2/maven-shared -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>maven-shared</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.axis2/axis2-xmlbeans-codegen -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-xmlbeans-codegen</artifactId>
<version>1.8.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.ws.xmlschema/xmlschema-core -->
<dependency>
<groupId>org.apache.ws.xmlschema</groupId>
<artifactId>xmlschema-core</artifactId>
<version>2.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j-impl -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.19.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.maven/maven-plugin-api -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.appengine/appengine-api-1.0-sdk -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>2.0.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.axis2/axis2-kernel -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
<version>1.8.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.axis2/axis2-adb -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>1.8.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.axis2/axis2-adb-codegen -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb-codegen</artifactId>
<version>1.8.2</version>
</dependency>
</dependencies>