gpt4 book ai didi

java - XML-RPC在JAVA中连接Confluence

转载 作者:行者123 更新时间:2023-12-01 13:14:47 25 4
gpt4 key购买 nike

我必须在JAVA中使用XML-RPC将图片上传到confluence。

JAVA代码

import java.util.Vector;
import java.util.Hashtable;
import helma.xmlrpc.*;
import java.util.Arrays;

public class test {

// The location of our server.
private final static String server_url =
"http://confluence.xyz.com:8080/rpc/xmlrpc";

public static void main (String [] args) {
try {

// Create an object to represent our server.
XmlRpcClient server = new XmlRpcClient(server_url);

Vector<Object> params = new Vector<Object>();
params.add("username");
params.add("pass");

String token = (String) server.execute("confluence2.login", params );
System.out.println(token);
}
catch (Exception exception) {
System.err.println("JavaClient: " + exception.toString());
}
}
}

我收到错误

JavaClient: java.io.IOException: SAX driver not found: org.apache.xerces.parsers.S

最佳答案

您需要添加额外的xercesImpl-2.2.1.jar为了这。如果您使用maven ,您只需添加 xercesImpl maven dependency如下:

<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.2.1</version>
</dependency>

希望对你有帮助!

关于java - XML-RPC在JAVA中连接Confluence,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22558235/

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