Hey,
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.net.URISyntaxException; import java.util.ArrayList; import javax.ejb.Stateless; import javax.inject.Inject; import javax.inject.Named; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import PACKAGE_NAME.JiraService; @Api(tags = { "jira" }) @Named @Stateless @Path("jira") public class AktuelleBugs { @Inject JiraService JiraService; @GET @Path("/getAktuelleBugs") @Produces(MediaType.APPLICATION_JSON) public ArrayList<String> getAktuelleBugs() throws URISyntaxException { return JiraService.getAktuelleBugs(); } }
/*JiraService.java*/ public ArrayList<String> getAktuelleBugs() throws URISyntaxException{ JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory(); URI uri = new URI("https://mycompany.com/jira/"); 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) { issueList.add(issue.getKey()); issueList.add(issue.getSummary()); issueList.add(issue.getPriority().getName()); } return issueList; }
Front End gets JSON (BACKEND_URL = localhost:8080/Application_Name/rest/)
angular.module('Application_Name').controller('aktuelleBugs', function ($scope, $http, $q, BACKEND_URL) { 'use strict'; var deferred = $q.defer(); $http({ method : "GET", url : BACKEND_URL + "jira/getAktuelleBugs" }).then(function (response) { deferred.resolve(response.data); }, function myError(response) { deferred.reject(response); }); deferred.promise.then(function(bugs){ ... ... .
When starting the server(JBOSS) locally everything works fine.
Hoping that this issue can be solved as soon as possible
Community moderators have prevented the ability to post new answers.
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
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?!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Darn, those would be really helpful
Then all I can advise is to try to systematically narrow down the problem:
If you at least know where the error happens, you might get an idea of the reason
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.