10 Replies Latest reply on Mar 8, 2012 1:33 AM by Jacek Dabrowski

    migrate to jboss 7 - How to get the module name to implement a dynamic lookup for global JNDI

    Mostafa Far Newbie

      Hi,

       

      I am migrating an application from jboss 4.3 to 7.1CLR, I have a dynamic service locator which perfectly works for dynamic lookup within a module after making according changes with jndi naming in Jboss 7 which looks like this:

       

      "java:module/" + serviceInterface.getSimpleName() + "Bean" + "!" + serviceInterface.getCanonicalName()

       

      ex:

      java:module/MessagingServiceBean!my.com.infotest.ictest.kernel.messaging.service.MessagingService

       

      But if i need to do any lookup out of the current module i do have to call the service through "java:app/moduleName" or "java:.global:/ moduleName". The problem is how i can get the module name by just knowing Service/Object name, and build a Jndi naming like this:

       

      java:app/kern-messaging-ejb/MessagingServiceBean!my.com.infotest.ictest.kernel.messaging.service.MessagingService

       

       

      Thanks for any help.

      Mostafa Far