SDK Session creation fails intermittently due to Error code 60002: You have not logged in.

I encountered following error in Agile PLM 9.3.6, during Agile SDK session creation process for a standalone, scheduled and multithreaded job.

Stack trace:

Error code : 60002

Error message : You have not logged in.

Root Cause exception : java.lang.ClassCastException: narrowFrom’ClusterableRemoteRef Initialized?=true(5397721842345319656S:xx.xx.xxx.xxx:[xxxxx,xxxxx,-1,-1,-1,-1,-1]:agileDomain:serverhost-Managed1 [5397721842345319656S:xx.xx.xxx.xxx:[xxxxx,xxxxx,-1,-1,-1,-1,-1]:agileDomain:serverhost-Managed1/362])/362′ narrowTo:’interface com.agile.common.client.remote.PCMHelperSessionHome’Recursive narrow detected

at com.agile.api.AgileSessionFactory.createSession(AgileSessionFactory.java:1151)

 

Also, this issue occurs intermittently and not for all threads. There are some threads for which session creation is successful for same user and for some it fails. In some cases session creation for all thread are successful. This issue was not observed in Agile 9.3.3 environments and the code works perfectly fine. 

 

I would like to know if anyone from the community encountered this before and any ideas for troubleshooting this issue. 

 

Weblogic: 12.2.1.1

Agile PLM: 9.3.6 RUP1

 

Code snippet for session creation called from all threads:

public IAgileSession getThreadSession() throws APIException {

 

  Map<Integer, String> params = new HashMap<>();

  AgileSessionFactory instance = AgileSessionFactory.getInstance(AGILEURL);

  params.put(AgileSessionFactory.PX_USERNAME, “username”);

  params.put(AgileSessionFactory.PX_PASSWORD, “cleartextpassword”);

  return instance.createSession(params);

  }

Add Comment
4 Answer(s)

Is it fixed ? . I see Oracle opened a bug and then closed it later on due to inability to reproduce.

Agile Angel Answered on September 20, 2017.
Add Comment

Hello,

I encountered this same exception sometime back.
The root cause exception in my case wasn’t ‘java.lang.ClassCastException’ but it was ‘java.lang.ExceptionInInitializerError’.

I figured that I was using the wrong version of AgileAPI.jar.
I extracted it from the target agile server and replaced with the one I was using and it resolved the issue.

You can give it a try.

Cheers,

Agile User Answered on September 26, 2017.
Add Comment

Thank you for the responses. This issue is fixed by synchronizing the session creation API and the HashMap parameters. But, Oracle still could not identify the root cause as existing code works fine in Agile 9.3.3 but not in Agile 9.3.6.

Agile User Answered on September 26, 2017.

So that means you changed the AgileAPI.jar, right?

on September 27, 2017.
Add Comment

Did you delete the local machine’s cache of Agile PLM connection info ?

The above connection code tries to re-use previously successful login meta data.  On windows, the cache is at:
C:UsersYourIDAppDataLocalTempAgileSDK.cache
Remove/Clear and retry

And DO NOT use muti-threading UNTIL execute the connection in single thread and confirmed that session is valid.  In fact, for any processing code that you hit Agile PLM via SDK, I would not use multiple threads.

Agile Talent Answered on October 18, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.