jeudi 30 juillet 2015

What does this lookup addresses mean in Wildfly 8?

I have tested my first sessoin bean using Wildfly 8. I use the following code to obtain a proxy for the bean

InitialContext ctx = new InitialContext();
Object obj = ctx.lookup("java:global/EJBDemo/FirstDemoEJB");

When I print the object out I get the following output

Proxy for remote EJB StatelessEJBLocator{appName='', moduleName='EJBDemo', distinctName='', beanName='FirstDemoEJB', view='interface com.demo.ejb.FirstDemoEJBRemote'}

I can proceed with the RMI with the above lookup and get the desired result.

However, I observed that there are other lookup paths as listed by Wildfly at the time of deployment.

java:global/EJBDemo/FirstDemoEJB!com.demo.ejb.FirstDemoEJBRemote
java:app/EJBDemo/FirstDemoEJB!com.demo.ejb.FirstDemoEJBRemote
java:module/FirstDemoEJB!com.demo.ejb.FirstDemoEJBRemote
java:jboss/exported/EJBDemo/FirstDemoEJB!com.demo.ejb.FirstDemoEJBRemote

When I use the other lookup names names (part before the ! mark), I get the following output

EJBDemo/FirstDemoEJB -- service jboss.naming.context.java.app.TestEJB.EJBDemo.FirstDemoEJB

But I cannot RMI and get the desired result as in the java:global lookup.

My question is what does these other lookup paths listed by Wildfly mean? and can they be used for JNDI lookup as well? If so how to do it?

Aucun commentaire:

Enregistrer un commentaire