tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sells <dse...@gmail.com>
Subject JNDI EJB Lookup and OpenEJB Loader Application
Date Wed, 22 Jul 2009 16:46:02 GMT
I am trying some basic tests with *Stateless*  *EJB*'s using the Calculator
example.  I am running into difficulties with:

 *JNDI* with respect to setting the *InitialContext* correctly for
*remote*lookups.


*Scenario*:

I have deployed the Calculator example with a Remote interface into a *
Tomcat* environment (with the OpenEjb Servlet installed).  I have been able
to lookup and invoke the calculator using a *standalone* program using the
following code:

Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.apache.openejb.client.RemoteInitialContextFactory");
properties.setProperty(Context.PROVIDER_URL, "
http://127.0.0.1:8080/openejb/ejb/");
InitialContext initialContext = new InitialContext(properties);
CalculatorRemote calculator = (CalculatorRemote)
initialContext.lookup("java:cal-1.0/CalculatorRemote");
result = cow.multiply(2, 333);

Now I tried this same code inside a web application to see if it would work
and it failed.   This web application was running in the same instance of
tomcat that the EJB is deployed in.

*Question*:

 What is the correct context to set for the given scenario?

Thanks,

David

(sorry if this is appearing twice.  It didn't seem to appear the first
time... was part way through registration.)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message