我正在尝试使用WSDL使用Axis 2(1.7.3)和tomcat服务器(V6.0)创建一个简单的Web服务,同时创建一个Web服务客户端我收到此错误,我已尝试通过更改要添加的服务器版本或删除一些jar文件,但似乎没有任何工作。
我已将XMLSchema core - 2.2.1 jar文件添加到lib文件夹并将其添加到项目构建路径,我还将XMLSchema文件添加到服务器配置文件夹,但似乎没有任何工作。我使用的是jdk 1.8.0版。较低版本它仍然无法工作,我正在使用Eclipse Neon。我不知道我错过了什么。
下面是我在服务器端制作的WSDL:
<?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>
我添加了错误的图片:
<Qazxswpoi>。
您必须将This is the error, I am getting again and again添加到类路径中。你可以下载它xmlscema-core.jar
如果使用maven,请添加以下依赖项
here
这主要是由于缺少依赖性。 NoClassDefError是在加载相同类的多个版本或类路径不正确的情况下。有很多方法可以解决这个问题:
<!-- 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>
希望这可以帮助。