• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Entity Bean Lookup Exception

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using IPlanet NAS (SP1).
I want to call an entity bean from session bean. However i get lookup(Naming) exception.
The same code works fine when i call the bean from a servlet.
Can you tell me the possible reason for the look up failure fron S bean. Is there any other method to b followed in case of bean referring another bean ?
Other than findbyPrimaryKey the other finder methods give me an exception. I guess i dont have to write the code in my EJB class ??
Please help me on this.
regards
jani prashant
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's hard to tell, with no code posted. Remember that in EJB 1.1 you have to specify the remote referenced in the deployment descriptor with the "ejb-ref" tag.
mcd
 
Prashant Jani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by mcd:
It's hard to tell, with no code posted. Remember that in EJB 1.1 you have to specify the remote referenced in the deployment descriptor with the "ejb-ref" tag.
mcd


Well i am pating the code which i have used both in servlet ( which works) and the S'less session bean.

String JNDI_NAME="TestAcc";
javax.naming.Context initial=null;
java.util.Hashtable env =new java.util.Hashtable(1);
try{
initial = new javax.naming.InitialContext(env);
}
catch(Exception e) {
System.out.println("could not get initContext");
}
try{
Object objref = null;
objref = initial.lookup(JNDI_NAME);
//objref = initial.lookup("TestAcc"); // tried this also
TestAccHome home = (TestAccHome)PortableRemoteObject.narrow(objref, TestAccHome.class);
TestAcc duke = home.create("1", "Duke", "Earl", 50.00);
}
catch(javax.naming.NamingException e)
{
System.out.println("Lookup exception ");
}
catch(Exception e)
{
System.out.println("Lookup exception " + e);
}
I get "Lookup exception "

I guess this should be helpful to you.

regards
jani prashant
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic