Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g (

Part Number E13981-01
Go to Documentation Home
Go to Book List
Book List
Go to Table of Contents
Go to Index
Go to Feedback page
Contact Us

Go to previous page
Go to next page
View PDF

Handling Exceptions

This section describes the following:

Recovering From a NamingException While Accessing a Remote Enterprise Bean

If you are trying to remotely access an enterprise bean and you receive an javax.naming.NamingException error, your JNDI properties are probably not initialized properly. See "Load Balancing" for a discussion on setting up JNDI properties when accessing an enterprise bean from a remote object or remote servlet.

Recovering From a NullPointerException While Accessing a Remote Enterprise Bean

When accessing a remote enterprise bean 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 enterprise bean set dedicated.rmicontext to true.

The following demonstrates how to use this additional environment property:

Hashtable env = new Hashtable( );
env.put (Context.SECURITY_PRINCIPAL, "oc4jadmin");
env.put (Context.SECURITY_CREDENTIALS, "oc4jadmin");
env.put (Context.PROVIDER_URL, "ormi://myhost-us/ejbsamples");
env.put ("dedicated.rmicontext", "true"); // for and later
Context context = new InitialContext (env);

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

Recovering From Deadlock Conditions

If the call sequence of several beans causes a deadlock scenario, OC4J notices the deadlock condition and throws a Remote exception that details the deadlock condition in one of the offending beans.