Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in entity bean with local interfaces

 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i am writing Entity bean with local interfaces which created table in db and then access same table.
when i create entity bean with local interfaces and then access this entity bean by stand alone client it throws exception in lookup code as shown below

Above code is not able to locate CustomerRHome.

But if i convert same bean into remote i.e(using EJBObject and EJBHome)then it create and access table in db successfully.
i am not able to understand why i am not able to access Entity bean using local interfaces by standalone client.

Please Help me
thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that the thing JNDI refers to is the local interface ? You may have forgotten to make it point to it, and left it point to the Remote interface.
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you talking about EJB Refs.
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am accessing simple stateless bean using local interfaces my code is


In deploytool i am clicking JNDI Names and using ejb/sessionTest as JNDI name.The tool deployes bean successfully.
Now in stand alone program i access bean as shown below
[/code]
Context initial = new InitialContext();
Object o = initial.lookup("ejb/sessionTest");

[/code]
Above code throw exception as Exception in thread "main" javax.naming.NameNotFoundException"

Please help me.
Thanks
 
Rodrigo Dinis
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I think you cant use a local interface accessing from a stand alone client, because they are in diferent container.

Best regards,
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you talking about EJB Refs.

Yes. Did you change the home and remote tags to local-home and local ?
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a stand alone client cannot access entity bean with local interfaces.
I managed to access entity bean with local using Session bean(session facade design pattern).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic