This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
1) Setting up the Context properties, which including pointing to the server hosting the JNDI service. This code which you posted, is an example for this:
2) The second part (after the context has been setup) is to do a lookup using a key (also known as JNDI name) which is done as follows:
The com.bekijkhet.HelloStateless is the JNDI name. Even though it looks like a fully qualified classname of the bean interface, in reality it can be any string which represents the JNDI name of the bean. While deploying a bean on the server, each bean has a unique JNDI name on the server, so that the clients can lookup it up using that name.
Joined: Jun 19, 2008
Hi Jaikiran Pai,
Yes, i understood.
Now, the jndi name that is mentioned in the lookup operation is key, which we use for getting the bean, which has been injected already.
My question is, is there a way to assign new name for bean, while deploying in glassfish, because i didn't see any option for that.
This is really useful : If the stand-alone java client is running on a different host than the server, set the -Dorg.omg.CORBA.ORBInitialHost property when starting the client JVM. E.g.
java -Dorg.omg.CORBA.ORBInitialHost=com.acme.Host1. This property defaults to localhost, so it is not necessary to set it if the java client is running on the same machine as the server.