Unexpected character "60" - Error trying to login to RTC java api
I am trying to login to RTC java api 6.0.2 using:
TeamPlatform.startup();
repo = TeamPlatform.getTeamRepositoryService().getTeamRepository(repoUri);
repo.registerLoginHandler(new ILoginHandler2() {
public ILoginInfo2 challenge(ITeamRepository repo) {
return new UsernameAndPasswordLoginInfo(userId, password);
}
});
repo.login(monitor);
but I'm getting the error below when executing the repo.login () method:
com.ibm.team.repository.common.TeamRepositoryException: Unexpected character "60": line 3, column 1
at com.ibm.team.repository.client.internal.TeamRepository.fetchClientVersionJSONObject(TeamRepository.java:1746)
at com.ibm.team.repository.client.internal.TeamRepository.access$0(TeamRepository.java:1699)
at com.ibm.team.repository.client.internal.TeamRepository$5.run(TeamRepository.java:1770)
at com.ibm.team.repository.client.internal.TeamRepository$5.run(TeamRepository.java:1)
at com.ibm.team.repository.client.internal.TeamRepository$3.run(TeamRepository.java:1328)
at com.ibm.team.repository.common.transport.CancelableCaller.call(CancelableCaller.java:79)
at com.ibm.team.repository.client.internal.TeamRepository.callCancelableService(TeamRepository.java:1323)
at com.ibm.team.repository.client.internal.TeamRepository.checkServerVersionMatches(TeamRepository.java:1773)
at com.ibm.team.repository.client.internal.TeamRepository.internalLogin(TeamRepository.java:1521)
at com.ibm.team.repository.client.internal.TeamRepository.login(TeamRepository.java:654)
at com.ibm.team.repository.client.internal.TeamRepository.login(TeamRepository.java:628)
at snippets.Snippet1.login(Snippet1.java:67)
at snippets.AllSnippets.main(AllSnippets.java:28)
Caused by: java.io.IOException: Unexpected character "60": line 3, column 1
at com.ibm.team.repository.common.json.internal.Tokenizer.next(Tokenizer.java:113)
at com.ibm.team.repository.common.json.internal.Parser.parse(Parser.java:30)
at com.ibm.team.repository.common.json.JSONObject.parse(JSONObject.java:72)
at com.ibm.team.repository.client.internal.TeamRepository.fetchClientVersionJSONObject(TeamRepository.java:1744)
... 12 more
This code was working normally, but suddenly came to give this error. Does anyone know how to solve this problem?
Accepted answer
Based on the last comment from Robert:
The URL and all other information is okay, by browser access normally. This java code, using the API, was working normally and suddenly came to give error when calling the login method. The RQM version is 6.0.2
As of CLM 6.x you can no longer safely use the RTC Plain Java API to access all parts of RQM or RM. If you feel you should, please open a case with support.
Comments
One other answer
Tons of examples and how to can be found here: https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/
You can especially run the code from within Eclipse and debug it. You also want to follow the suggestions to install the SDK at some time.
Make sure to use the Java that ships with the version of RTC you use (shippedt in the RTC Client or the server).
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Aug 16 '18, 4:07 p.m.SUSHEN SARKAR
Sep 13 '18, 2:28 p.m.Herbert Roberto
Sep 07 '18, 2:44 p.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Sep 10 '18, 4:09 a.m.SUSHEN SARKAR
Sep 10 '18, 11:19 a.m.Herbert Roberto
Sep 10 '18, 8:01 p.m.