Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Developer's Guide

- Previous: Naming Environment for J2EE Application Components
- Next: Accessing EJB Components in a Remote Application Server

## Accessing EJB Components Using the CosNaming Naming Context

The preferred way of accessing the naming service, even in code that runs outside of a J2EE container, is to use the no-argument `InitialContext` constructor. However, if EJB client code explicitly instantiates an `InitialContext` that points to the CosNaming naming service, it is necessary to set these properties in the client JVM when accessing EJB components:

    -Djavax.rmi.CORBA.UtilClass=com.sun.corba.ee.impl.javax.rmi.CORBA.Util
    -Dorg.omg.CORBA.ORBClass=com.sun.corba.ee.impl.orb.ORBImpl
    -Dorg.omg.CORBA.ORBSingletonClass=com.sun.corba.ee.impl.orb.ORBSingleton
    -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory

- Previous: Naming Environment for J2EE Application Components
- Next: Accessing EJB Components in a Remote Application Server

- © 2010, Oracle Corporation and/or its affiliates