cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to create repository session

Former Member
0 Kudos

I am getting below error while connecting to MDM repository using UserSessionContext

Exception in thread "main" com.sap.mdm.session.SessionException: Cache of SessionManager does not include session correspondent to session context '[server=SAPDSWFS.JNJ.COM serverUser=Admin repository=PG_PRODUCT region= user=gswetala]'. Attempt to create a new session failed.

  at com.sap.mdm.internal.session.InternalSessionManager.getSession(InternalSessionManager.java:251)

  at com.sap.mdm.session.SessionManager.getSession(SessionManager.java:78)

  at com.sap.mdm.session.ConnectionManager.getSessionConnection(ConnectionManager.java:137)

  at com.sap.mdm.session.AbstractSessionCommand.<init>(AbstractSessionCommand.java:45)

  at com.sap.mdm.session.AbstractRepositorySessionCommand.<init>(AbstractRepositorySessionCommand.java:35)

  at com.sap.mdm.security.commands.GetRoleListCommand.<init>(GetRoleListCommand.java:62)

  at com.jnj.mdm.connection.MDMConnection.<init>(MDMConnection.java:59)

  at com.jnj.mdm.audit.MainMethod.main(MainMethod.java:23)

Caused by: com.sap.mdm.session.SessionException: Can not authenticate 'repository session' '[server=SAPDSWFS.JNJ.COM serverUser=Admin repository=PG_PRODUCT region= user=gswetala]' because user password is not specified

  at com.sap.mdm.internal.session.InternalSessionManager.validateUserNameAndPassword(InternalSessionManager.java:1502)

  at com.sap.mdm.internal.session.InternalSessionManager.createRepositorySession(InternalSessionManager.java:1016)

  at com.sap.mdm.internal.session.InternalSessionManager.innerGetSession(InternalSessionManager.java:759)

  at com.sap.mdm.internal.session.InternalSessionManager.getSession(InternalSessionManager.java:249)

  ... 7 more

Can anybody give idea, why this error is coming?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,


"Can not authenticate 'repository session' ", have u checked the log-in credential passed.

A sample code could be useful.

Regards,

Former Member
0 Kudos

Hi I have checked the login credential is fine. Below is the code

if(repositoriesIdentifier[i].toString().equals("PG_PRODUCT")){

  //System.out.println("userSessionContext "+userSessionContext.get);

  userSessionContext = new UserSessionContext(servername,repositoriesIdentifier[i].toString(), userid);

  GetRoleListCommand roleListCommand = new GetRoleListCommand(userSessionContext);

  roleListCommand.execute();

  System.out.println("Executed Role Command Sucess");

  RoleProperties[] roleProperties = roleListCommand.getRoles();

  for(int ak=0;ak<roleProperties.length;ak++){

  System.out.println("role"+roleProperties[ak]+roleProperties[ak].getName());

  }

  }

Former Member
0 Kudos

If the login credintials are correct,

Try to use this constructor of class UserSessionContext,

UserSessionContext(java.lang.String serverName, java.lang.String serverUserName, RepositoryIdentifier repository, java.lang.String userName).


i.e. just pass additional valid Server User Name as parameter.


if that doesn't resolve the issue, check whether the target repositories are up and running.



Regards,