Connecting to Sun

To connect to a Sun server:
  1. In the Connect to Naming Service dialog box, choose SUN J2EE Server from the Server list box.
  2. From the Factory list box, choose com.sun.jndi.cosnaming.CNCtxFactory
  3. In the Provider Url text box, type iiop://red:1050. The port may vary depending on the configuration of the server.
  4. Click Edit Classpath ... and specify the following server and client classpaths:
    1. 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.
    2. 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.
  5. Verify your settings and click Next. The names of all registered EJBs and RMI objects that are hooked into your Sun server are browsed.
  6. 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.
  7. Click Finish.
  8. 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.
  9. 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.
  10. Click Next.
  11. 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.
  12. Click OK. You can now call any of the EJBs business methods.