【问题标题】:Error generating WSDL in intellij : ClassNotFoundException: org.apache.woden.WSDLException在 intellij 中生成 WSDL 时出错:ClassNotFoundException: org.apache.woden.WSDLException
【发布时间】:2020-11-20 01:39:56
【问题描述】:

我现在有 2 天的问题,我不知道如何解决它,我在 IntelliJ 下有一个轴 2 项目,我想为客户端生成 wsdl,但是当我尝试使用工具时 - >WebServices->从 WSDL 生成 Java 代码..

Generate Java code from wsdl...

我有以下错误:

  Retrieving document at 'http://localhost:8080/Axis2_Server_war_exploded/services/HelloWorld?wsdl'.
 Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/woden/WSDLException
    at org.apache.axis2.description.WSDLToAxisServiceBuilder.<init>(WSDLToAxisServiceBuilder.java:103)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.<init> (WSDL11ToAxisServiceBuilder.java:225)
    at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.<init> (WSDL11ToAllAxisServicesBuilder.java:63)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:167)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:50)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
 Caused by: java.lang.ClassNotFoundException: org.apache.woden.WSDLException
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 6 more
 Done

我在服务器端的服务如下:

services.xml:

<serviceGroup>
<service name="HelloWorld">
    <parameter name="ServiceClass">HelloWorld.HelloWorld</parameter>
    <operation name="sayHelloWorldFrom">
        <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
    </operation>
</service>
</serviceGroup>

HelloWorld.java:

@WebService
 public class HelloWorld {
    @WebMethod
    public String sayHelloWorldFrom(String from) {
        String result = "Hello, world, from " + from;
        System.out.println(result);
        return result;
    }
 }

客户端maven依赖:

    <dependencies>
    <dependency>
        <groupId>org.apache.woden</groupId>
        <artifactId>woden-core</artifactId>
        <version>1.0M10</version>
    </dependency>

    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-kernel</artifactId>
        <version>1.7.9</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-transport-local</artifactId>
        <version>1.7.9</version>
    </dependency>

    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-adb</artifactId>
        <version>1.7.9</version>
        <scope>compile</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.axis2/axis2 -->
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2</artifactId>
        <version>1.7.9</version>
        <type>pom</type>
    </dependency>

    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-transport-http</artifactId>
        <version>1.7.9</version>
    </dependency>

</dependencies>

感谢您的帮助!

【问题讨论】:

标签: java intellij-idea axis2


【解决方案1】:

我通过转到 File->Settings->Tools->Web 服务 并设置正确的 axis2 二进制分发 解决了这个问题:

http://www.apache.org/dyn/closer.lua/axis/axis2/java/core/1.7.9/axis2-1.7.9-bin.zip

(我有一个 IntelliJ IDEA)。

【讨论】:

  • 这也解决了我的问题。我从 Intellij 下载了它,即使版本号相同,它也不起作用。
  • @apfalz 很高兴帮助了 ^^
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多