EJB3 lookup on websphere

Posted by dcp on Stack Overflow See other posts from Stack Overflow or by dcp
Published on 2010-05-18T00:57:45Z Indexed on 2010/05/18 1:00 UTC
Read the original article Hit count: 406

Filed under:
|

I'm just starting to try to learn Websphere, and I have my ejb deployed, but I cannot look it up. Here's is what I have:

public class RemoteEJBCount {
 public static Context ctx;
 private static String jndiNameStateless = "EJB3CounterSample/EJB3Beans.jar/StatelessCounterBean/com/ibm/websphere/ejb3sample/counter/RemoteCounter";

 public static void main(String[] args) throws NamingException {


     RemoteCounter statelessCounter;

     Hashtable<String, Object> env = new Hashtable<String, Object>();
     env.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809");
     env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
     ctx = new InitialContext(env); 

     statelessCounter = (RemoteCounter)ctx.lookup(jndiNameStateless);
 }
}

Is there something I need to be doing differently to look up the EJB?

© Stack Overflow or respective owner

Related posts about websphere

Related posts about ejb