[jboss-as7-dev] JNDI lookup and EJB invocation from a remote client

Jaikiran Pai jpai at redhat.com
Sun Oct 30 23:21:05 EDT 2011


This is the example:

@RunWith(Arquillian.class)
@RunAsClient
public class RemoteEJBJNDIAccessTestCase {

      private Context initialContext;

      @Before
      public void beforeTest() throws Exception {
          final Properties initCtxProps = new Properties();
          initCtxProps.put(Context.URL_PKG_PREFIXES,
"org.jboss.ejb.client.naming");
          this.initialContext = new InitialContext(initCtxProps);
      }


      @Test
      public void testObtainJNDIProxy() throws Exception {
          final String distinctName = "";
          final EchoRemote echoRemote = (EchoRemote)
this.initialContext.lookup("ejb:" + APP_NAME + "/" + MODULE_NAME + "/" +
distinctName + "/" + EchoBean.class.getSimpleName() + "!" +
EchoRemote.class.getName());
          Assert.assertNotNull("Received a null proxy", echoRemote);
      }
}


Note that you won't be able to invoke on the proxy yet (and that's the 
reason for this thread). I also have a document which I'll be publishing 
soon, to explain the new EJB client API, it's usage and other details.

-Jaikiran
On Monday 31 October 2011 01:27 AM, Dieter Tengelmann wrote:
> David, you wrote:
>
> A) A standalone client should be able to look up a proxy from JNDI
> without configuring a client context (this already works).
>
> Is there somewhere an example, how to do this?
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev



More information about the jboss-as7-dev mailing list