It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Java API GET Request - 500 Internal Server Error

J Jan 11, 2017


all of my GET requests to JIRA return the Internal Server Error 500.

image2017-1-11 15:15:29.png


Backend Java Code:

import io.swagger.annotations.Api;

import java.util.ArrayList;

import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.inject.Named;

import PACKAGE_NAME.JiraService;

@Api(tags = { "jira" })
public class AktuelleBugs {

        JiraService JiraService;

    public ArrayList<String> getAktuelleBugs() throws URISyntaxException  {
        return JiraService.getAktuelleBugs();

public ArrayList<String> getAktuelleBugs() throws URISyntaxException{
            JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
            URI uri = new URI("");
            JiraRestClient client = factory.createWithBasicHttpAuthentication(uri, "user", "password");
            Promise<SearchResult> searchJql = client.getSearchClient().searchJql(
                    "project=\"System Betrieb\" AND issuetype != epic AND type=bug ORDER BY priority ASC");
            SearchResult searchResult = searchJql.claim();

            Iterable<Issue> issues = searchResult.getIssues();
            ArrayList<String> issueList= new ArrayList<String>();
            for (Issue issue : issues) {
            return issueList;


Front End gets JSON (BACKEND_URL = localhost:8080/Application_Name/rest/)

            function ($scope, $http, $q, BACKEND_URL) {
        'use strict';
      var deferred = $q.defer();
            method : "GET",
            url : BACKEND_URL + "jira/getAktuelleBugs"
        }).then(function (response) {
        }, function myError(response) {



When starting the server(JBOSS) locally everything works fine.


Hoping that this issue can be solved as soon as possible smile

5 answers

0 votes
Claudio Kirchhoff Jan 11, 2017

There should be an error message in the logs - can you post it?

On a sidenote: you should use 'jiraService' (lowercase) as a variable name!

0 votes
J Jan 11, 2017

Unfortunately I dont have access to the logs and thank you smile.

0 votes
Claudio Kirchhoff Jan 11, 2017

Darn, those would be really helpful smile

Then all I can advise is to try to systematically narrow down the problem:

  1. Return a hardcoded response from your REST endpoint and see if the error persists
  2. if no, then re-add the call to getAktuelleBugs() and return a hardcoded answer from there
  3. and so on, until you find out where exactly the error occurs

If you at least know where the error happens, you might get an idea of the reason

0 votes
J Jan 11, 2017

I guess I have to ask for the logs, because none of the things I tried worked.


Just for the record:


    Tried to return String "Hello world" with the class AktuelleBugs()

        REST Client was able to GET the String

    Different locations of the class had no effect


Could be an issue with the Server configuration of the JIRA host?!

0 votes
Claudio Kirchhoff Jan 12, 2017

So the error is in the AktuelleBugs() method. You could move 'return "hello world"' further down, line by line to determine the actual line of the error, but getting the logs is certainly the smart way to go smile

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Next-gen

Introducing subtasks for breaking down work in next-gen projects

Teams break work down in order to help simplify complex tasks. This is often done iteratively, with tasks being broken down into smaller tasks and so on until the work is accurately captured in well-...

8,469 views 26 38
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you