[jboss-user] [Beginners Corner] - How to lookup for a bean

rrusinkiewicz do-not-reply at jboss.com
Fri Oct 27 10:58:41 EDT 2006


I've deployed a bean and it can be found using a jboss jndi explorer under
under Global JNDI in

+- ejb1 (class: org.jnp.interfaces.NamingContext)
  |   +- ApptransCalculator (class: org.jnp.interfaces.NamingContext)
  |   |   +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
  |   |   +- local (class: java.lang.Object)
  |   |   +- remote (class: java.lang.Object)
  |   |   +- remoteStatefulProxyFactory (proxy: $Proxy77 implements interface org.jboss.ejb3.ProxyFactory)


In my jsp the lookup code looks as follows:

InitialContext ctx = new InitialContext();
       cal = (ApptransCalculatorLocal) ctx.lookup(
                   "java:comp/env/ejb/ApptransCalculator");

I also tried
  cal = (ApptransCalculatorLocal) ctx.lookup(
                   "ejb1/ApptransCalculator");

and
cal = (ApptransCalculatorLocal) ctx.lookup(
                   "ejb1/ApptransCalculator/local");


The cal is null after a lookup, what is hier wrong ?






 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981326#3981326

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981326



More information about the jboss-user mailing list