• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is wrong with this code?

 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
2 questions here.

First Question,
I deployed the AdviceBean from HF EJB and when I call the getPrimaryKey() on the AdviceBean I thought i will get a RemoteException (page 137). But i get the JNDI name as a result.

Second question,
When I called bean.isIdentical("test"), i was expecting false. but I got an exception. (since isIdentical message accepts object as parameter)



Any thoughts?
 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone?
 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got the answer for second question. The parameter should be of EJBObject type. Anyone has answer for the first question?
 
Gabriel Buheler
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whenever you want to lookup an ejb home, you have to use JNDI.

Remember you have to prepend the standard name:
java:comp/env

Good luck!

Gabriel
(SCJP, SCWCD, pursuing SCBCD)
 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it mandatory to prepend java:comp/env to JNDI names?
The EJB works fine and I don't have any problems compiling or running. I am not getting the error when I call getPrimaryKey() on a session bean. Anyone knows why?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic