To connect to a Sun server:
-
In the
Connect to Naming Service dialog box, choose
SUN J2EE Server from the
Server list box.
-
From the
Factory list box, choose
com.sun.jndi.cosnaming.CNCtxFactory
-
In the
Provider Url text box, type
iiop://red:1050.
The port may vary depending on the configuration of the server.
-
Click
Edit Classpath ... and specify the following server and client classpaths:
-
In the
Server Classpath text box, type the path to
j2ee.jar.
This file is provided by Sun and contains the J2EE implementation and the implementation used for connecting to the naming
mechanism of Sun. You can normally find the file in a lib subdirectory of the J2EE home directory.
-
In the
Client Classpath text box, type all JAR files and classpaths that are required to connect to the EJB.
You usually put the client-side stubs and additional classpath entries into the client classpath. Sun J2EE servers automatically
generate the stubs when EJBs are deployed.
-
Verify your settings and click
Next.
The names of all registered EJBs and RMI objects that are hooked into your Sun server are browsed.
-
Choose the home interface that allows for the creation of instances of EJBs.
It is typical for EJBs to have home interfaces that are used to create EJB instances.
-
Click
Finish.
-
In the
Load File Wizard, click
Next.
The home interface you have selected is browsed for the published methods it includes. A method named create is likely to
be among these methods. Call this method to get a valid reference to an EJB object.
-
Click
Next and select the test case where
Java Explorer should write code for the steps that are performed by the wizard.
For example, you can put the steps that are referred to as
bootstrapping into the init test case or an existing test case.
-
Click
Next.
-
Check the
Store as variable check box and type a name for the EJB reference obtained by the
Java Explorer Wizard into the
Variable name text box.
-
Click
OK.
You can now call any of the EJBs business methods.