首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JIRA Java REST客户端返回500错误

问JIRA Java REST客户端返回500错误
EN

Stack Overflow用户
提问于 2014-08-20 12:43:01
回答 1查看 2.3K关注 0票数 0

因此,我试图使用JerseyJiraRestClientFactory设置对JIRA的基本HTTP调用。我有所有的依赖,现在我有这个..。

代码语言:javascript
复制
public class SetUp {

    public static void main(String[] args) throws Exception {
        final NullProgressMonitor pm = new NullProgressMonitor();
        final Console console = System.console();

        if (console == null) {
            System.out.println("Couldn't get Console instance");
            System.exit(0);
        }

        String user = console.readLine("Enter your user name: ");
        char[] password = console.readPassword("Enter your password: ");
        char[] confirm = console.readPassword("Confirm password: ");

        while (!(new String(password).equals(new String(confirm)))) {
            console.printf("Error: Passwords do not match. Please Re-enter your password\n");
            password = console.readPassword("Enter your password: ");
            confirm = console.readPassword("Confirm password: ");
        }
        try {

        JerseyJiraRestClientFactory f = new JerseyJiraRestClientFactory

        System.out.println("\nafter 1");

        JiraRestClient jc = f.createWithBasicHttpAuthentication(new URI(
                "my_server"), user, new String(password));
        System.out.println("\nafter 2");

        Iterator<BasicProject> r = jc.getProjectClient().getAllProjects(pm).iterator();

        System.out.println("\nafter 3");

        int count = 0;
        while (r.hasNext()) {
            count++;
        }

        System.out.println("\nafter 4");
        System.out.println("There are " + count + " issues.");
        user = "";
        Arrays.fill(password, ' ');
        }
        catch (com.atlassian.jira.rest.client.RestClientException e) {
            System.out.println(e.getCause());
        }
    }
}

所以这个错误就出现在打印“2”之后。我得到了这个错误代码

“线程中的异常”主“com.atlassian.jira.rest.client.RestClientException: com.sun.jersey.api.client.UniformInterfaceException:客户机响应状态: 500”

我试着打电话给不同的方法,结果都是相同的500。我也尝试使用不同的登录,包括有效的和无效的,它们都是500个。有人知道怎么解决这个问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-08-21 10:15:31

HTTP代码500是一个“内部服务器错误”,因此这与您的密码无关。(这应该会导致像401(未经授权的)或403(禁止的))有人在亚特兰西安论坛上问过类似的问题,请在这里查看:https://answers.atlassian.com/questions/263719/using-oauth-and-the-jira-java-rest-client。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25405044

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档