Skip to Content

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

Retrieve user sessions from all nodes / force_remote

Hello,

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, "com.sap.engine.services.jndi.InitialContextFactoryImpl"); 
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|http://help.sap.com/saphelp_nw04/helpdata/en/8d/41ee1b22797c4b9d9b7ad67aa7333f/content.htm]. But that generates the error you see below.

env.put("force_remote", "true");

#1.#C6CD2000E002007600000BC8001ED034000477BB4B57FFF1#1257546213490#com.sap.engine.core.cluster.impl6.JoinPortListener#
#com.sap.engine.core.cluster.impl6.JoinPortListener.run()#Guest#0##n/a#
#af6c4ad0cb2211de9d23c6cd2000e002#SAPEngine_Application_Thread[impl:3]_24#
#0#0#Error##Plain###java.io.IOException: Invalid connection identification byte: 118.
        at com.sap.engine.core.cluster.impl6.JoinPortListener$SocketProcessor.run(JoinPortListener.java:191)
        at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
        at java.security.AccessController.doPrivileged(AccessController.java:219)
        at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
        at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
#com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception while trying to get InitialContext.  
Root exception is com.sap.engine.interfaces.cross.DestinationException: cannot establish connection with any of the available instances 
Nested exceptions are: com.sap.engine.services.rmi_p4.exception.P4BaseIOException: Cannot open connection on host:  and port:

Does anyone know how to resolve this problem?

Thanks in advance,

John

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