Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Retrieve user sessions from all nodes / force_remote


I am trying to retrieve all user sessions from all nodes in a J2EE portal environment. The code below works great. However, it only returns the users from the node I am currently attached to.

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, ""); 
env.put(Context.PROVIDER_URL, serverIP + ":" + serverPort + "#" + serverId);
env.put("force_remote", "true");

InitialContext context = new InitialContext(env);
Object obj = context.lookup( "remotesecurity" );
RemoteSecurity remoteSecurity = (RemoteSecurity) PortableRemoteObject.narrow(obj, RemoteSecurity.class);

RemoteSecuritySessions sessions = remoteSecurity.getSecuritySessions();
SecuritySession securitySession[] = sessions.listSecuritySessions();

So I included this statement to attach to remote servers per [SAP instructions|]. But that generates the error you see below.

env.put("force_remote", "true");
#af6c4ad0cb2211de9d23c6cd2000e002#SAPEngine_Application_Thread[impl:3]_24# Invalid connection identification byte: 118.
        at Exception while trying to get InitialContext.  
Root exception is cannot establish connection with any of the available instances 
Nested exceptions are: Cannot open connection on host:  and port:

Does anyone know how to resolve this problem?

Thanks in advance,


Former Member
Not what you were looking for? View more on this topic or Ask a question