Trying to find a Stock CMP Entity beans local interface from a session bean.
Using Rational Application Developer 7, from the Universal Test Client I can find the StockCMPLocalHome interface. However with the following jndi code variations from the session bean I cannot find it.
I have provided the output below, note it cannot even find the ejb namespace in some.
-BEGIN ERR---------------------------- [18/07/07 21:13:45:781 CEST] 00000023 SystemOut O ONE FAILED java:comp/env/ejb/Stock Err=Name comp/env/ejb not found in context "java:". [18/07/07 21:13:45:781 CEST] 00000023 SystemOut O TWO FAILED java:comp/env/ejb/StockCMPLocal Err=Name comp/env/ejb not found in context "java:". [18/07/07 21:13:45:781 CEST] 00000023 SystemOut O THREE FAILED java:comp/env/Stock Err=Name "comp/env/Stock" not found in context "java:". [18/07/07 21:13:45:781 CEST] 00000023 SystemOut O FOUR FAILED java:comp/env/ejb/StockCMP Err=Name comp/env/ejb not found in context "java:". [18/07/07 21:13:45:781 CEST] 00000023 SystemOut O FIVE FAILED java:comp/env/ejbs.StockCMPLocalHome Err=Name "comp/env/ejbs.StockCMPLocalHome" not found in context "java:". [18/07/07 21:13:45:781 CEST] 00000023 SystemOut O SIX FAILED java:comp/env/ejbs.StockCMP Err=Name "comp/env/ejbs.StockCMP" not found in context "java:". -END ERR----------------------------
The JNDI name is specified in the <ejb-local-ref> element in the entity bean EJB deployment descriptor. It should look like this:
You should now be able to do a JNDI look up using "java:comp/env/ejb/StockCMPBean".
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Philip Rowley
Greenhorn
Joined: Jul 18, 2007
Posts: 4
posted
0
Hi
I tried to implement your xml but still cannot find namespace ejb. I also noticed you referenced the StockList session bean instead of the Stock entity bean in <local-home> and <local>.
I tried with your xml which referenced the entity and session bean. This failed with java:comp/env/ejb/StockCMPBean Err=Name comp/env/ejb not found in context "java:".
-BEGIN--------
JNDI Call Used = "java:comp/env/ejb/StockCMPBean"; Error Msg = java:comp/env/ejb/StockCMPBean Err=Name comp/env/ejb not found in context "java:".
Looking at the error msg, it seems to me that it cannot get past the EJB namespace see msg again below
java:comp/env/ejb/StockCMPBean Err=Name comp/env/ejb not found in context "java:".
Thanks
Phil
Philip Rowley
Greenhorn
Joined: Jul 18, 2007
Posts: 4
posted
0
When calling a local lookup from a Session or Entity bean, and it's looking for its self it works.
But when calling a local lookup from Session or Entity bean, and it's looking for a different Entity or Session bean it fails.
However, when I create a refence from an entity bean to a sessoin bean etc.. it works (thanks Roger).
ie using <ejb-local-ref> tag.
Why does this exist? It seems like an overhead with no real use? Can anyone suggest some reading, I have not come across this in my books, or understood it when I have read it.