4

I am trying to make a simple webservice using WSDL using Axis 2 (1.7.3) and tomcat server (V6.0) while creating a webservice client I am getting this error, I have tried everything by changing the versions of server to add or delete some jar files but nothing seem to work.

I have added XMLSchema core - 2.2.1 jar file to lib folder and add it to project build path , also I add the XMLSchema file to the server config folder, but nothing to seem to work for this. I am using jdk version 1.8.0. with lower versions it still don't work and I am working Eclipse Neon. I don't know what I am missing.

Below is my WSDL which is being made at server end:

<?xml version="1.0" encoding="UTF-8"?>

  <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

  <wsdl:port binding="impl:OperatorClassSoapBinding" name="OperatorClass">

     <wsdlsoap:address location="http://localhost:8080/Testwebservice/services/OperatorClass"/>

  </wsdl:port>

I have added the picture of the error:

<This is the error, I am getting again and again>.

Neha
  • 91
  • 1
  • 2
  • 12

5 Answers5

2

You have to add the xmlscema-core.jar to your classpath. You can download it here

If you use maven, add the following dependency

<!-- https://mvnrepository.com/artifact/org.apache.ws.commons.schema/XmlSchema -->
<dependency>
    <groupId>org.apache.ws.commons.schema</groupId>
    <artifactId>XmlSchema</artifactId>
    <version>1.4.7</version>
</dependency>
Jens
  • 67,715
  • 15
  • 98
  • 113
  • I have already added the xmlschema-core.jar file to classpath. Still somehow after re - starting the eclipse it does not give me the same error, but still gives the error and it is "Exception occurred during code generation for WSDL : org.apache.axis2.AxisFault: More than one part for message addRequest" – Neha Sep 16 '16 at 20:50
  • Please help, if you know the solution for the above error now. – Neha Sep 16 '16 at 20:51
  • And then after you updated your pom.xml with the dependency that you said, we must run "Maven Install" in the context menu "Run As". It will solved my trouble. Thank you very much my friend. God bless you – Richard Rebeco Jan 13 '21 at 03:12
1
  1. Use AXIS 1.6.4 (instead of Latest 1.7.4)
  2. Tomcat 7
  3. Dynamic Web Project 2.5
  4. Set Axis 2 runtime location to 1.6.4 - Eclipse -> Preferences -> Web Services -> Axis 2 Preferences
Jerome Campbell
  • 359
  • 2
  • 5
0

This is mostly due to missing dependencies. The NoClassDefError is when there are multiple versions of same class are loaded or classpath is not proper. There are many ways to solve this:

  1. Add jars one by one till transitive dependencies are resolved.
  2. Keep all jars from AXIS web application lib directory as part of AXIS_LIB library and add it as dependency.
  3. Refer maven dependencies list and add those jars with correct version and correct java/javac compiler level and runtime. Reference: axis2 maven example
  4. Create a new project using eclipse or SoapUI tool and generate a webservice from tool. This will generate the dependencies and libraries for you.

Hope this helps.

Community
  • 1
  • 1
Amit Mahajan
  • 895
  • 6
  • 34
  • I have already applied the 4th option several times, it does not help at all. I am not using maven,. I do not exactly understand your first and second point, is that mean to add jar files one by to classpath? as only xmlschema-core file was not in the lib folder. – Neha Sep 16 '16 at 21:17
  • It will work :) , first there is difference between Axis2 server and client. As I understand you want to create a server and host services. You need to have the AXIS_JARS configured for server.You can refer the example I shared and add these jars to classpath as well as lib. If this is confusing you can also use Axis2 war file directly. Import the war file and add your changes on top of it. – Amit Mahajan Sep 16 '16 at 21:48
0

Add woden-core-1.0M10.jar in your lib folder.

Maven :

<dependency>
    <groupId>org.apache.woden</groupId>
    <artifactId>woden-core</artifactId>
    <version>1.0M10</version>
</dependency>
Devendra
  • 1,864
  • 6
  • 29
  • 49
-2

Use a lower jdk version. Window>Preferences>Java>Installed JREs

Sotelo
  • 1
  • 1
  • 2
    Usually, downgrading to a lower JDK version is not desired and, Java being backwards compatible, should not be necessary either. If you think that downgrading the JDK actually helps in this case, it would be great if you included the reason in your answer by using the _edit_ link below it. – msrd0 Jul 29 '20 at 19:23