Introduction
The naming service manages a set of namespaces that resolve the name binding problems of Data objects. The Java Naming and directory interface (Java™namingand directory Interface,jndi) is a set of APIs that provide access to naming and directory services. Many Java applications use JNDI to locate resources, such as data sources and Enterprise JavaBeans (Enterprise JAVABEANS,EJB) that are registered in the Java 2 Enterprise Edition (Java 2 Enterprise Edition).
Ibm®java Thin client applications provide a lightweight environment that enables you to access the Java EE resources from the outside through JNDI, allowing you to waive the overhead of maintaining the Java EE platform on the client machine.
Create a resource to find
In this section, you will create a simple stateless session Bean, implement a method in it, and deploy the EJB to the Websphere®application Server. Later in this article, you will create a remote thin client application that accesses the EJB through JNDI and invokes his public methods.
We will do this with the WebSphere Studio application Developer V5.0 (hereinafter called Applicationdeveloper). The method described in this article to locate and invoke a remote object is valid only if used with the Java Runtime environment provided by the WebSphere application ServerV5.
Create a Java EE Enterprise application project
Start Application Developer, and then create a Java EE Enterprise Application project:
Select File => New Enterprise application Project.
In the Enterprise Application Project Creation window, select Create Java EE 1.3 Enterprise Application project:
Figure 1. Create a Java EE 1.3 Enterprise Application project
Click Next.
In the Enterprise Application project creation window, name the item simple. For an attached module project, select EJB module and name the module Simpleejbmodule:
Figure 2. Create an EJB module for the Enterprise Application project