2.6.8 Precautions for using the user-specified name space functionality
(1) Notes on executing a search using an optional name
- An Enterprise Bean with a local interface cannot be searched from outside the J2EE application.
- The optional name of the Enterprise Bean with a local interface cannot be searched for the naming contexts.
- You can set up the same optional name for the Enterprise Bean with a remote interface and the Enterprise Bean with a local interface. However, if you look up the optional name that is duplicated in such a case, the Enterprise Bean with a local interface will necessarily be looked up.
(2) Notes on the naming service
- When one CORBA Naming Service is shared by multiple J2EE servers, you cannot use the user-specified name space functionality.
- Specify settings so that the J2EE server and the CORBA Naming Service start and stop at the same time.
If either the J2EE server or the CORBA Naming Service is down, restart the J2EE server and the CORBA Naming Service together.
- If the CORBA Naming Service is shared, you cannot use 'Cosminexus' as the optional name to be set up in the user-specified name space functionality.
(3) Notes on specifying the optional names for the J2EE resources
- When you stop, delete, or change the attributes (for a JavaMail session) of the J2EE resource for which the optional name is registered, first stop all the J2EE applications running on the J2EE server.
- When using the user-specified name space functionality of a J2EE resource, specify the same string as the host name of the provider URL (java.naming.provider.url), specified in InitialContext generated by the J2EE application and the value of the ejbserver.naming.host key specified in the J2EE server definition. Note that if this condition holds true, you need not specify the provider URL for InitialContext that is generated by the J2EE application.
- Specify localhost (default value) in the ejbserver.naming.host key of the user property file for J2EE servers.
- Connect to the naming service on the same J2EE server.
If localhost is specified in the ejbserver.naming.host key, and if you want to specify the provider URL for InitialContext generated by the J2EE application, specify the value that can be acquired using the following API in the host name of the provider URL: java.net.InetAddress.getLocalHost().getHostName();
- Even if the optional name in the user-specified name space functionality of a J2EE resource contains a forward slash (/), you cannot perform a naming context search. Only the specified optional name can be used as the lookup name.
The examples of JNDI lookup names that can and cannot be used for the J2EE resources (DB Connector) that are deployed and started with "jdbc/TestDB" assigned as an optional name are as follows:
- Example of a lookup name that can be used
- DataSource ds = (DataSource) initCtx.lookup("jdbc/TestDB");
- Example of a lookup name that cannot be used
- Context ctx = (Context) initCtx.lookup("jdbc");