It's all about the answers!

Ask a question

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


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

Accepted answer


permanent link
Ralph Schoon (63.1k33645) | answered Sep 10 '19, 2:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Sep 10 '19, 3:00 a.m.

 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.

Ralph Schoon selected this answer as the correct answer

Comments
Geoffrey Clemm commented Sep 10 '19, 10:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

So just to confirm I understand this, Robert is trying to use the RTC (EWM) plain java API to login to an RQM (ETM) repository, and this is no longer working.   Similarly, if you tried this to login to a DNG repository, we don't expect that to work.

But we would expect this to work if you used the RTC plain java API to log into an RTC repository, is that right?    


Ralph Schoon commented Sep 10 '19, 10:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

According to his comment, that is correct. I have heard about the RTC API not working any more for all JAZZ Foundation based products. I did not try to use a uri for QM - I can.



Ralph Schoon commented Sep 10 '19, 10:42 a.m. | edited Sep 10 '19, 10:49 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Well, the login still works for my 6.0.6 QM (and CCM). I have however heared that there are issues using the RTC Plain Java API against other products. And this could also be related to use Jazz Authorization Server and other security/authentication options. That it works on my vanilla demo setup does not mean it will always work.

One other answer



permanent link
Ralph Schoon (63.1k33645) | 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.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.