Skip Headers

Oracle® Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 2 (10.1.2)
Part No. B15505-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Recovering From NullPointerException While Accessing a Remote EJB

When accessing a remote EJB from a Web application, you receive the following error: "java.lang.NullPointerException: domain was null ". In this case, you must set an environment property in your client while accessing the EJB set dedicated.rmicontext to true.

The following demonstrates how to use this additional environment property:

Hashtable env = new Hashtable( );
env.put (Context.INITIAL_CONTEXT_FACTORY,
    "com.evermind.server.rmi.RMIInitialContextFactory");
env.put (Context.SECURITY_PRINCIPAL, "admin");
env.put (Context.SECURITY_CREDENTIALS, "admin");
env.put (Context.PROVIDER_URL, "ormi://myhost-us/ejbsamples");
env.put ("dedicated.rmicontext", "true"); // for 9.0.2.1 and above
Context context = new InitialContext (env);

See "Load Balancing Options" for more information on dedicated.rmicontext.