Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Plz, help. A problem with calling EJB in different jar.

 
dar
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I have two EJBeans in different jars.
EJB "UserBean" is in the "Userbeans.ejbgrp" and "Userbeans.jar", package is "users".
EJB "GuestBean" is in the "Guestbeans.ejbgrp" and "Guestbeans.jar, package is "guests".
And in ejb-jar.xml for EJB "GuestBean":
...
<ejb-ref>
<ejb-ref-name>ejb/userref</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>users.UserHome</home>
<remote>users.User</remote>
<ejb-link>./Userbeans.jar#UserBean</ejb-link>
</ejb-ref>
...
Here is code from "GuestBean.java":
...
javax.naming.Context context = new javax.naming.InitialContext(); //line 102
Object objref = context.lookup("java:comp/env/ejb/userref");
...
I have another "ejb-jar.xml" for "GuestBean" in different directory(package).
When i try to run the application , i am getting exception:
javax.naming.NameNotFoundException: Missing Node - userref
at com.inprise.j2ee.jndi.java.javaContext.internal_lookup(javaContex.java:511)
at com.inprise.j2ee.jndi.java.javaContext.lookup(javaContext.java:97
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at users.User.getUser(UserBean.java:102)
HOW CAN I FIX IT?
I'm using JBuilder5 and IAS.
Than U for advice.
 
Phil Sharp
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had trouble doing this with WLS.
Using WLS I had to create ejb-reference-description elements in the weblogic-ejb-jar.xml file which creates a link using JNDI names as well as the ejb-ref elements in ejb-jar.xml. Unfortunately this is WLS specific, you might want to check if IAS does something similar.
Phil
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic