• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDI not found for local entity beans in RI server

 
Prashant Neginahal
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I am stuck with one problem in using RI server.The JNDI lookup is getting failed for local entity bean where as it is working fine for remote interfaces. Is there any EXTRA seeting for JNDI in RI server for accessing local interfaces?

Please somebody help.

Thanks,
Prashant
 
Lahiru Abeydeera
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I'm also stuck with that problem. How can you specify the JNDI for a local entity bean.

Lahiru
 
David McDonagh
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post a sample of your code?
 
Prashant Neginahal
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my code. I assume nothing wrong with th code because we are able to deploy it.

Component Interface
------------------------------------------
public interface Client extends EJBLocalObject{
public String getId();

public void setName(String s);
public String getName();
}
--------------------------------------


Home Interface
----------------------------------
public interface ClientHome extends EJBLocalHome{
public Client create(String id, String num) throws CreateException;

public Client findByPrimaryKey(String name) throws FinderException;
}
--------------------------------------------

Bean Class
-------------------------------------------

public abstract class ClientBean implements EntityBean{

EntityContext context = null;

public abstract void setId(String s) ;
public abstract String getId() ;

public abstract void setName(String s) ;
public abstract String getName() ;

public void ejbActivate(){
}

public void ejbPassivate(){
}

public void ejbRemove(){
}

public void setEntityContext(EntityContext conx){
context=conx;
}
public void unsetEntityContext(){
}

public void ejbLoad(){
}

public void ejbStore(){
}

public String ejbCreate(String id, String name) throws CreateException{
this.setId(id);
this.setName(name);
return null;
}

public void ejbPostCreate(String id, String num) throws CreateException{
}
}
------------------

Thanks,
Prashant
 
Prashant Neginahal
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please, somebody have a look on this problem.

Lahiru, did u get the solution? Please share with me.

Thanks,
Prashant
 
Rup Ped
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think there is nothing wrong with your ejb code. It must be in the way you are accessing your local entity beans from the client. Try this out:

Object objref = ic.lookup("local:ejb/xxxxxxxx/ClientHome");

where xxxxxx is your package structure (ejb/myjava/...)

Hope it helps.
 
Prashant Neginahal
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
somebody please tell me how look up for local beans using RI.

Thanks,
Prashant
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic