2 Replies Latest reply on May 2, 2019 1:17 AM by jaikiran

    JNDI name includes .jar suffix in module name

    swany

      Per the Wildfly naming docs:

       

      module-name : This is the name of the .jar (without the .jar suffix) that you have deployed on the server and the contains your EJBs. If the EJBs are deployed in a .war then the module name is the .war name (without the .war suffix).

       

      However, my JNDI names for *only one JAR* are being deployed as follows (with ".jar" in the module portion):

       

      2019-04-29 07:42:56,867 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-6) WFLYEJB0473: JNDI bindings for session bean named 'HostSession' in deployment unit 'subdeployment "host.jar" of deployment "resq.ear"' are as follows:

       

              java:global/race/host.jar/HostSession!com.romaric.race.mgr.host.ejb.session.host.HostSessionRemote

              java:app/host.jar/HostSession!com.romaric.race.mgr.host.ejb.session.host.HostSessionRemote

              java:module/HostSession!com.romaric.race.mgr.host.ejb.session.host.HostSessionRemote

              java:jboss/exported/race/host.jar/HostSession!com.romaric.race.mgr.host.ejb.session.host.HostSessionRemote

              ejb:race/host.jar/HostSession!com.romaric.race.mgr.host.ejb.session.host.HostSessionRemote

              java:global/race/host.jar/HostSession!com.romaric.race.mgr.host.ejb.session.host.HostSessionLocal

              java:app/host.jar/HostSession!com.romaric.race.mgr.host.ejb.session.host.HostSessionLocal

              java:module/HostSession!com.romaric.race.mgr.host.ejb.session.host.HostSessionLocal

              ejb:race/host.jar/HostSession!com.romaric.race.mgr.host.ejb.session.host.HostSessionLocal

       

      All other JARs appear normal (no ".jar" suffix in the module portion of the JNDI names):

       

      2019-04-29 07:42:56,867 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-7) WFLYEJB0473: JNDI bindings for session bean named 'AccessSession' in deployment unit 'subdeployment "access.jar" of deployment "resq.ear"' are as follows:

       

              java:global/race/access/AccessSession!com.romaric.race.mgr.access.ejb.session.AccessSessionRemote

              java:app/access/AccessSession!com.romaric.race.mgr.access.ejb.session.AccessSessionRemote

              java:module/AccessSession!com.romaric.race.mgr.access.ejb.session.AccessSessionRemote

              java:jboss/exported/race/access/AccessSession!com.romaric.race.mgr.access.ejb.session.AccessSessionRemote

              ejb:race/access/AccessSession!com.romaric.race.mgr.access.ejb.session.AccessSessionRemote

              java:global/race/access/AccessSession!com.romaric.race.mgr.access.ejb.session.AccessSessionLocal

              java:app/access/AccessSession!com.romaric.race.mgr.access.ejb.session.AccessSessionLocal

              java:module/AccessSession!com.romaric.race.mgr.access.ejb.session.AccessSessionLocal

              ejb:race/access/AccessSession!com.romaric.race.mgr.access.ejb.session.AccessSessionLocal

       

      I can't find any reason why this one JAR would be different. No annotations, no ejb-jar.xml file with overridden module names - nothing. To make things even weirder, the same JAR is deployed in two separate EAR applications. For one, ".jar" is not appended but for the second application - it is!

       

      Any insight would be greatly appreciated.

       

      Thanks,

       

      Mark

        • 1. Re: JNDI name includes .jar suffix in module name
          jewellgm

          You mentioned that the same jar is being utilized in two separate ear deployments.  Could this just be a mechanism that is used by Wildfly to prevent apparent naming collisions at the "app" level?  Have you tried manually deploying your applications to determine whether the second application deployed always gets the ".jar" in the lookup name?  Maybe you could create a 3rd ear that only contains the common jar and supporting code.  You would need to use the global lookup rather than the app/module lookups, but your lookup name would be deterministic.

          • 2. Re: JNDI name includes .jar suffix in module name
            jaikiran

            Which exact version of WildFly is it? And when you say the same jar is used in another .ear, I guess you mean a copy of that jar right?

             

            swany  wrote:

             


             

            I can't find any reason why this one JAR would be different. No annotations, no ejb-jar.xml file with overridden module names - nothing.

            What about a application.xml in the .ear within which this jar is showing up this issue? The application.xml too allows configuring module name and maybe it has overriden the module name for this jar?