gpt4 book ai didi

java - 找不到 Axiom 类

转载 作者:行者123 更新时间:2023-11-30 04:37:13 25 4
gpt4 key购买 nike

我正在尝试编译 Axis2 附带的简单 SOAP 客户端示例。但是 Java 编译器找不到导入:

import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;

我已经在命令行上检查了我的类路径变量是最新的,它包括:

C:\axis2-1.6.1\lib

我还检查了 lib 目录是否包含所需的 Axiom jar(确实如此)

axiom-api-1.2.12
axiom-dom-1.2.12
axiom-impl-1.2.12

这些 jar 与我正在导入的包匹配(它们确实匹配)。我怎么仍然收到错误:

 error: package org.apache.axiom.om does not exist

最佳答案

Asix2 User Guide介绍了Axis2工具的目录结构和使用方法,防止需要设置CLASSPATH环境变量:

The bin directory includes a number of useful scripts. They include axis2.bat (or axis2.sh), which enables you to easily execute a Java command without having to manually add all the Axis2 jar files to the classpath

关于java - 找不到 Axiom 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13192131/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com