Beginners questions: Using EJBs on two Workstations

Discussion in 'Java' started by bebonights, Oct 13, 2003.

  1. bebonights

    bebonights Guest

    Hi folks,

    I have developed several EJB-Examples with j2sdkee1.3 running the
    J2EE-Server and the Client (Java-Application) on one Computer. Now I
    would like to try it with two Workstations - one running the
    J2EE-Server, the other running the client.

    Both Workstations are properly connected, the Station I'd like to use
    for the server has the IP 111.111.111.111, the Client-Station has
    111.111.111.112.

    My questions (Please detailed answers a beginner can understand...)


    1) How should the following Client be changed to do what I want:

    -------------------------------------------------------------
    package hallo;

    import javax.naming.*;
    import javax.rmi.*;

    public class HalloClient
    {
    public static void main(String[] args)
    {
    try
    {
    Context context = new InitialContext();
    Object object = context.lookuk("java:comp/env/ejb/Hallo");
    HalloHome home = (HalloHome)PortableRemoteObject.narrow(
    object, HalloHome.class);
    Hallo hallo = home.create();
    System.out.println(hallo.sagHallo());
    }
    catch (Exception e)
    {
    e.printStackTrace();
    }
    }
    }
    -------------------------------------------------------------

    I know that I should create a Hashtable-Object with several Properties
    (INITIAL_CONTEXT_FACTROY, PROVIDER_URL) - but what values should I
    use?


    2) How should the Server-Machine be set up? Up to now, the only server
    displayed in the deploytool is localhost.


    3) How should the Client-Machine be prepared? Which files does the
    client need? Only the jar-file containing the RMI-Stubs, which is
    created when the application is deployed? The ear-file? The package
    j2ee.jar? Or is it the easiest was to install j2sdkee1.3 on the
    Client-Machine?


    Thanks for your answers!
     
    bebonights, Oct 13, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JSM
    Replies:
    7
    Views:
    399
  2. Patrick May
    Replies:
    3
    Views:
    361
    Sudsy
    Aug 19, 2003
  3. Vjeran Marcinko

    EJBs as active components?

    Vjeran Marcinko, Oct 16, 2003, in forum: Java
    Replies:
    5
    Views:
    511
    Emanuel Bulic
    Oct 17, 2003
  4. JG@HG
    Replies:
    2
    Views:
    393
    JG@HG
    Jun 11, 2008
  5. JG@HG
    Replies:
    2
    Views:
    139
    JG@HG
    Jun 11, 2008
Loading...

Share This Page