Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Questions about the methods getEJBObject() and getEJBLocalObject()

 
Jiafan Zhou
Ranch Hand
Posts: 193
Fedora Linux Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know where and when should we use these two methods declared in the SessionContext.

I used them by "trials and errors", but always get java.lang.IllegalStateException.

An example will be highly appreciated.
 
Christian Nicoll
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jiafan,

take a look at MZ Notes, there you find those lines:

...The getEJBObject method returns the session bean's remote interface. Only session
beans with a remote EJBObject interface can call this method...

...The getEJBLocalObject method returns the session bean's local interface. Only session
beans with a local EJBLocalObject interface can call this method...
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!