on 03-27-2007 9:10 AM
Hi,
I have an application which gets a list of user sessions from servers in production cluster.
There are 5 servers in the cluster.
Then problem is that I'm always getting a list of user sessions only from the current server on which the user is logged on, and not
from all servers. Maybe it has something to do with initialcontext parameters.
Here is the code to connect to the specific server in the cluster:
Hashtable env = new Hashtable();
env.put("force_remote", "true");
env.put(Context.PROVIDER_URL, "191.138.54.10:50704#78139452); //address is different of course
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();
....
PS.
When I use this code from another server (test server) and connect to the production cluster, I'm getting the full list of user sessions from all nodes in the production cluster.
So it working everywhere except when it is deployed to production server and run from there.
Maybe somebody has idea how to handle this or which parameters should I put into the InitialContext?
Regards,
Ladislav
Hi Ladislav,
Unfortunately, that is not possible to be done when you are already running on the server. The "#serverID" directive can be specified only for external clients. You cannot jump from one server node to another in the <b>same instance</b>, only to a different instance in the same or different cluster.
For more info please have a look at <a href="http://help.sap.com/saphelp_nw04/helpdata/en/08/8f633e0084e946e10000000a114084/frameset.htm">this</a> document.
Best regards,
Vladimir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you tell me in which JAR file the RemoteSecurity and RemoteSecuritySessions classes reside?
I have searched my portal server directories but cannot find which JAR files I need to include to get the code running in NetWeaver Developer Studio.
Thanks,
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ladislav, Tom,
This is the jar of the Security service (physically located at /usr/sap/<SID>/<instance>/j2ee/cluster/server<N>/bin/services/security). At runtime you should reference this service in your J2EE app's application-j2ee-engine.xml (<a href="http://help.sap.com/saphelp_nw04/helpdata/en/53/69662514eb6e46b1eb6e77ae5cf10b/frameset.htm">more info</a>).
To get the code built and running in the NWDS (i.e. a standalone app) you need to add the following jar in the build path of your Java project: <NWDS_root_folder>eclipsepluginscom.sap.tc.apcompSAP-JEEDCssap.comcom.sap.engine.client.lib\_compgendefaultpublicdefaultlibjavasapj2eeclient.jar (<a href="http://help.sap.com/saphelp_nw04/helpdata/en/88/3c8342fa4b5551e10000000a1550b0/frameset.htm">more info</a>).
However, please note that these are internal J2EE Engine APIs and are not released for custom applications development. They might be changed at any time in a future SPS/release, so it's at your own risk if you decide to use them. All publicly available APIs can be found <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/javadocs">here</a>.
Best regards,
Vladimir
Hi,
I read with attention this topic.
I wonderred what was the best solution to get the users logged into the portal??
I made a Web dynpro, with the code found in the wiki part on this site. But it doesn't show the user if he logged in but didn't made any action into the portal.
I can not understand this, he must be in the logged in users if he just logged in???
If anyone could help me.
Thanks in advance.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.