How client talks to EJB Component

Discussions

EJB design: How client talks to EJB Component

  1. How client talks to EJB Component (4 messages)

    I have

    Hello (Remote)
    helloBean (Bean implementation)
    HelloHome (Home)

    Q1 is When I compile these classes, container is responsible to create implementation of the remoter internface, where this file goes, and what is the role of this new implemented class.

    Q2 What class should be copied to client machine to execute the ejb component. (if client is on different machine)

    Q3 How client talks to server

    thanks,
    fa.

    Threaded Messages (4)

  2. How client talks to EJB Component[ Go to top ]

    Hi,

    i answered briefly to u'r questions, as i understood:

    Q1 is When I compile these classes, container is responsible to create implementation of the remoter internface, where this file goes, and what is the role of this new implemented class.

    A1 After compiling u'r java files u need to deploy the bean. This process differs among vendors. When u r deploying the beans, the container tool checks for the vaildity and generates ejb object and home object and generates any necessary RMI stubs and skeletons and STORE in the Container. The skeletons r responsible for server side and stubs r for clients.


    Q2 What class should be copied to client machine to execute the ejb component. (if client is on different machine)

    U have to copy the Client class, the remote interface, home interface and primarykey classes if any. Include these classes in the class apth of the remote m\c

    Q3 How client talks to server

    In short, The client application uses the home interface to access the home object. this is achieved by lookup of jndi described while deploying. The home object can create, remove and find instances of the enterprise bean class it uses. The client uses the remote interface to access the EJB object. The EJB object can invoke the business methods of an enterprise bean instance.

    If u need a detailed expalnation better read "Enterprise java beans " from oreilly publications.

    Regards
    Saran



  3. How client talks to EJB Component[ Go to top ]

    First of all thanks to you.

    I m using WebLogic 6.0

    I have copied

    HelloClient
    Hello (remote) //compiled by javac
    HelloHome (home) //compiled by javac

    I dont have the primary key.

    my client machine is
    cl001
    my weblogic machine is
    cl002

    what classpath should be, on what machine?

    The following code comes from HelloClinet.java

    // Get an InitialContext
    private Context getInitialContext() throws NamingException {
        try {
          Properties h = new Properties();
          h.put(Context.INITIAL_CONTEXT_FACTORY,
            "weblogic.jndi.WLInitialContextFactory");
          h.put(Context.PROVIDER_URL, url);
          return new InitialContext(h);
        } catch (NamingException ne) {
          log("<      throw ne;
        }
      }


    ------------

    and we are getting the follwing error

    <
    fa.
  4. How client talks to EJB Component[ Go to top ]

    one correction here

    h.put(Context.PROVIDER_URL, url); //url="t3://cl002:7001"

    fa.
  5. How client talks to EJB Component[ Go to top ]

    chang the machine name to the ip address and try again.
    may your DNS server isn't work properly.

    huang