I have a WSDL file from a SOAP Web service provided by another company to us. Based on that WSDL in our project we have generated a Client Stub by using Eclipse and Axis2 v1.7.9. Because of some vulnerability issues on Axis 2 v1.7.9 issues, we need to generate a new Client Stub but using Axis2 v1.8.
These are the steps we make for generation:
- Eclipse Version: 2024-03 (4.31.0)
- Unzipped https://archive.apache.org/dist/axis/axis2/java/core/1.8.0/
- In Eclipse we set in Preferences-> The Axis2Preferences set to the unzipped folder
- Created in Eclipse a webservice project and added the WSDL (received from an external source - from the WebServer team) to it.
- Right clicked on the WSDL file and then-> Generate client ->Server Runtime Tomcat 8.5 Server settings at Web Service Runtime selected Apache Axis 2.
Then the next error is displayed:
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) at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runCommand(CommandFragmentEngine.java:421) at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.visitTop(CommandFragmentEngine.java:361) at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.moveForwardToNextStop(CommandFragmentEngine.java:256) at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager$6.run(SimpleCommandEngineManager.java:296) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:434) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:354) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1036) at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager.runForwardToNextStop(SimpleCommandEngineManager.java:266) at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.runForwardToNextStop(WizardPageManager.java:93) at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.performFinish(WizardPageManager.java:264) at org.eclipse.wst.command.internal.env.ui.widgets.DynamicWizard.performFinish(DynamicWizard.java:384) at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:837) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:474) at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619) at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:84) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4274) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660) at org.eclipse.jface.window.Window.runEventLoop(Window.java:823) at org.eclipse.jface.window.Window.open(Window.java:799) at org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard.run(DynamicPopupWizard.java:132) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:239) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:581) at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:415) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4274) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588) at org.eclipse.equinox.launcher.Main.run(Main.java:1459) I make these steps by using Axis2 v1.7.9 the client stub is generated. I also tried also to generate Client Stub with Axis2 v1.8.2 and it failed again.