Reputation: 31
I am stuck on a JNDI binding process on EJB3 and here is the source code which I am terribly stuck at.
/*
* Create session bean.
*/
public static AG20BWOPortal getSessionBean() throws NamingException, RemoteException, CreateException{
if(wo == null){
Context ic = new InitialContext();
System.out.println("test1");
Object obj = ic.lookup("ejb/sg/gov/hdb/ag20/ejb/AG20BWOPortalHome"); //JNDI name (from EJB module xmi file)
System.out.println("test2");
AG20BWOPortalHome home = (AG20BWOPortalHome) PortableRemoteObject.narrow(obj, AG20BWOPortalHome.class);
wo = home.create();
}
return wo;
}
My questions are
The home interface is removed as part of EJB3 migration process, hence how do I replace the home interfaces?
How do I bind in EJB3 standard?
Upvotes: 1
Views: 228
Reputation: 31
I am answering this on my own if anyone want to catch the drift of how I did this.
This would bind the EJB classes together.
PS: Do not forget to remove the extends from EJB's remote interface as well.
Upvotes: 1