tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chriskriel <chris.kr...@vcontractor.co.za>
Subject remote ejb lookup from within tomee
Date Wed, 14 Jan 2015 13:40:56 GMT
Using RemoteInitialContextFactory with URL=http://localhost:20/tomee/ejb from
within a .war to lookup an EJB annotated with @Local and @Remote succeeds if
the EJB is in the same .war. The outcome is the same whether I specify port
20, on which nothing listens on the localhost, or port 8080, on which tomcat
is listening. In the catalina.out log I see: 

/Jan 14, 2015 2:05:21 PM org.apache.openejb.client.EventLogger log
INFO:
RemoteInitialContextCreated{providerUri=http://localhost:20/tomee/ejb}/

but in the tomcat access log there is no request for /tomee/ejb. Using the
same lookup from a different client JVM does show up in the access log as
expected.

This seems to indicate that the JNDI provider has done an optimization and
did a local lookup because a remote lookup is not needed. This is not an
issue.

My issue is that I get the same behaviour when I try to lookup the reference
from another .war in the same Tomee JVM. A local lookup is attempted and the
reference is not available because the initial context is testing empty.
Based on the fact that a remote lookup works from a different JVM it should
also work in this scenario. It is probably needed here because of the
different Class Loaders.

Is there a different context per webapp in Tomee?

Has anyone else had the same experience?

If my observations are correct, what options do I have to control this
behaviour?

The option (as per the documentation) of using an @EJB reference with the
link specified in the ejb-jar.xml also complains about the reference not
being bound.
 




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/remote-ejb-lookup-from-within-tomee-tp4673369.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Mime
View raw message