I need to set the environment in the client so that i can receive
informations (eg. current user) in my server (ejb, orion-server).

what i tried on the clientside is:

Hashtable pros = new Hashtable();
pros.put( Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.ApplicationiInitialContextFactory" );
pros.put( Context.PROVIDER_URL, "ormi://localhost/ejbsamples" );
pros.put( Context.SECURITY_PRINCIPAL, szUser );
pros.put( Context.SECURITY_CREDENTIALS, szPasswd );
pros.put( "AdditionalInformation", szValue );
Context myContext = new InitialContext( pros );
myContext.lookup( ... );

On the serverside (eg. stateless sessionbean):

SessionContext ctx; /* already set via setSessionContext-method */

String szUser = ctx.getCallerPrincipal().getName();
Properties myProps = ctx.getEnvironment();


The problem is - as I think - that it's not even possible to get the
environment in the client-part, which obviously means, that no environment
was set!

For example the line (client):
System.out.println( myContext.getEnvironment() );
just prints: {}
(after I tried to set the properties, of course)

Any help is appreciated!

Thanks in advance
Eli


Reply via email to