Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Questions on context lookup local interface

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

i have implement two container managed session bean (beanA, beanB), and they are in the same applications. I can call beanA through a client program by following code:
Context ctx = new InitialContext();
beanARemote beanA = (beanARemote )ctx.lookup("beanA");

and i can call beanB through beanA as follow
Context ctx = new InitialContext();
beanBRemote beanB = (beanBRemote)ctx.lookup("beanB");

My question is , if beanA and beanB is in the same EJB container, i can't get the local interface through context.lookup("beanB")? Please kindly advise me on this.....

thank you!!
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by jerry king:
My question is , if beanA and beanB is in the same EJB container, i can't get the local interface through context.lookup("beanB")?



As long as the two beans are part of the same JVM, you can use the local interface. So yes, in this example you can use the local interface of beanB from beanA.
 
jerry king
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your reply. When i try to get local interface , i get the following excetpion:
Exception returned by remote server: {0}
javax.naming.NameNotFoundException: ASessionEJB not found

I am using Oracle 10.1.3.1 AS
 
author
Posts: 580
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jerry,

The likely cause is that the JNDI name is not correct. Take a look at this thread: http://forums.oracle.com/forums/message.jspa?messageID=1147428.

My co-author, Debu Panda, can definitely help you with this. I am not all that familiar with OC4J myself. Try posting here: http://www.manning-sandbox.com/forum.jspa?forumID=273.

Regards,
Reza
[ November 05, 2008: Message edited by: Reza Rahman ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic