I have a problem with my ejb jar file

Discussions

EJB design: I have a problem with my ejb jar file

  1. I have created 2 ejbs where in i have implemented local intefaces only.As this are 2 seperate jar files so when ever i deploy them locally into weblogic6 the EJB 1 can not make a look up to EJB 2.BUT again when i put all the codes for both the EJBs in a single jar file then it is working fine while doing lookup.

    Can anyone tell me that if I use local interface instead of remote interface then I have to place both my EJBs in a single jar file.

    Regards
    Sabyasachi
  2. Yes, the EJB have to be in the same JAR. Similarly, if your JSP/Servlet wants to use local interface you have to put the entire app in one EAR file.
  3. Hi,

    In order to communicate or maintain relationship between two local entity beans, both the beans have to be placed in the same jvm. It is not possible to interact between local entity beans present in different jvms. This is the reason basically the developers use a Remote Session Bean to communicate with the local entity beans.

    regards
  4. Hi,

    >
    > In order to communicate or maintain relationship between two local entity beans, both the beans have to be placed in the same jvm. It is not possible to interact between local entity beans present in different jvms. This is the reason basically the developers use a Remote Session Bean to communicate with the local entity beans.
    >
    > regards
  5. Well you can use the two seperate jars also , though specification does says not to do so .

    If you want to use two seperate jars i will suggest u to make a single ear filr containing botht jars and a application.xml file (check out for Weblogic) . This xml file will conatin information about your ear contents that is
    for example

    <application>
      <display-name>Sms</display-name>
      <description>Application description</description>
      <module>
        <ejb>jar1.jar</ejb>
      </module>
      <module>
        <ejb>jar2.jar</ejb>
      </module>
    </application>

    hopes this will work for you.

    cheers
    Dee