It's all about the answers!

Ask a question

Unexpected character "60" - Error trying to login to RTC java api


Herbert Roberto (112) | asked Aug 16 '18, 1:43 p.m.
edited Aug 17 '18, 6:11 a.m. by Muralidhar Rajagopal (6114)
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?

Comments
Ralph Schoon commented Aug 16 '18, 4:07 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

SUSHEN SARKAR commented Sep 07 '18, 12:02 p.m. | edited Sep 13 '18, 2:28 p.m.

Did you find any resolution to the problem. I am facing same issue and not finding resolution.


Herbert Roberto commented Sep 07 '18, 2:44 p.m.

 

I still have not found a solution. For now, nothing solved. If you can solve it, let me know


Ralph Schoon commented Sep 10 '18, 4:09 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

There is no information in the question that would be of any help. It is unclear what line 3 is and it is unclear what changed. One guess would be the URL provided is wrong. Copy the URL into a browser and open it there. 


SUSHEN SARKAR commented Sep 10 '18, 11:19 a.m.

 Nope url is fine. When I tried the same URL from a REST client it works fine with me. for me the error is "Unable to login: Unexpected character "60": line 1, column 1". I am trying to use the code snippet 1 file shared along with java api. Not sure what I am missing but this whole login process is very painful with lack of clarity in documentation. .


Herbert Roberto commented Sep 10 '18, 8:01 p.m.

 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

showing 5 of 6 show 1 more comments

One answer



permanent link
Ralph Schoon (54.9k23642) | answered Sep 11 '18, 2:21 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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).

Your answer


Register or to post your answer.