java - 在 Intellij : ClassNotFoundException: org. apache.woden.WSDLException 中生成 WSDL 时出错

标签 java intellij-idea axis2

我现在连续 2 天遇到问题,我不知道如何解决它,我在 IntelliJ 下有一个轴 2 项目,我想为客户端生成 wsdl,但是当我尝试使用 Tools->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

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

服务.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>

Hello World .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>

谢谢您的帮助 !

最佳答案

我通过去 解决了它文件->设置->工具->Web服务并设置正确的 Axis 2 二进制分布 :

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

(我有一个 IntelliJ IDEA)。

关于java - 在 Intellij : ClassNotFoundException: org. apache.woden.WSDLException 中生成 WSDL 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61530468/

相关文章:

java - RecyclerView 的项目在屏幕上的位置在运行时发生变化

java - 如何有条件地处理 Observable 链中的错误?

java - 如何在Intellij Idea中组织一个大型java项目

java - 无法使用 Intellij Idea 连接到 openshift

web-services - ServiceClass 对象未实现以下形式的所需方法 : OMElement login(OMElement e)

java - 让 Axis 1.1 客户端与 Axis2 服务对话

java - 无法使用 axis2 实例化 ADBDataSource 类型

java - 没有端点 URL 的 WSDL

java - frame.repaint() 不工作

Java Intellij : Make change on external lib code and take effect immediately