*******Client for an EJB******

Discussions

EJB design: *******Client for an EJB******

  1. Should and EJB Client be in the same package as the EJB ?

    If my EJb is under A.B.C
    then can my client (some servlet or main program..)
    be under X.Y.Z ?
    Or should it be present under A.B.C only ?

    reply asap
  2. Hi,
      It's not needed that the client has to be present in the same folder.Just copy the client jar file to the folder from where you want to run the client.
      For your information the client can also be in a different machine.Last but not the least what we do is distributed computing.

    cheers,
    Rajesh
  3. Should and EJB Client be in the same package as the EJB ?


    Of course not. What makes you think this?
  4. Okay!
    I'll rephrase my question.
    If not in the same package, then we need to import the EJB package into the client , right ?
    basically if I don't import it in the client, then
    I get a compile-time 'not found' error when the home interface or remote interface is being called in the client.

    So even if the EJB is on machine X, and my client is on machine Y, then I need to 2 things:
    1. Include the ejb-jar in my machine Y classpath
    2. Import the EJB package into the client. right ?

    Thanks anyway!

    Any more inputs are welcome.

  5. Hi,
      I don't think you need to have the entire ejb-jar file under your client directory. You only need to have the home and remote interfaces under your class path..as we are seperating the implementation here thru interfaces..
    Sunil.