• Post Reply Bookmark Topic Watch Topic
  • New Topic

lookup error  RSS feed

 
alex Rozario
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i am new to this forum and as well as new to ejb concepts

i was trying to do small application in ejb 3.0
i am using oracle JDeveloper.

i created one entity bean named First.java and created interfaces as FirstEJBLocal and FirstEJBRemote. and i was created FirstEJBBean as bean class. then i created FirstEJBClient to run this application

I kept all under a same package named ejbfirst.
while compiling all it doesn't throws any error.
but while running

Context jndiContext =getInitialContext();
Object ref = jndiContext.lookup("FirstEJBBean");
FirstEJBLocal fstif =(FirstEJBLocal)PortableRemoteObject.narrow(ref,FirstEJBLocal.class);

it didn't execute and exited from the application
then i used debug option to find an error
the error was in the line,

Object ref = jndiContext.lookup("FirstEJBBean");

what is the problem in this
it may b very childish
but please help me to overcome it

Thank you
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was trying to do small application in ejb 3.0

If this is a 3.0 application, then why do you have local and remote interfaces ? You don't need them anymore.
 
alex Rozario
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you mr.satou
thank you for your response.

then how can i change my codings.
ofcourse even though i have created two interfaces i didn't used both.

i am using oreilly's enterprise javabeans 3.0 5th edition.
which book should i follow.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have that book, but since it's talking about EJB3, it should be ok. Maybe you're doing some 2.X examples ? You should use annotations instead. In your book, look for "bean class", "business interface", and annotations like @Stateless, @Stateful, @MessageDriven...

If you're still lost, you can try "EJB3 In Action", which is really easy to follow.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!