• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NamingException 'null' with lookup of entiy bean

 
chuck keuper
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a session bean (ProfileSession), an entity bean (Member), and a ProfileSessionTestClient with JBuilder9. Within the ProfileSessionTestClient I can lookup the jndi name "ProfileSession" for the session bean. The code is below:
try {
//get naming context
Context context = new InitialContext();
//look up jndi name
Object ref = context.lookup("ProfileSession");
//look up jndi name and cast to Home interface
profileSessionHome = (ProfileSessionHome) PortableRemoteObject.narrow(ref, ProfileSessionHome.class);
I am having a problem with the lookup of the entity bean within the getMember() in the ProfileSessonBean.java code. This code is listed below:
public String getMember(Integer ID) {
String strMemberName = null;
try {
Context ctx = new InitialContext();
Object obj = ctx.lookup("Member");
MemberHome aMemberHome = (MemberHome) PortableRemoteObject.narrow(obj, MemberHome.class);
Member aMember = aMemberHome.findByPrimaryKey(ID);
The error that is being returned is "Return value from getMember(1): NamingException 'null'.
". Can some one help?
 
Frank Chen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's normally caused by something wrong (class name, pacakge) on your remote in your descriptor.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic