5 Replies Latest reply on Apr 7, 2011 7:45 PM by genman

    AS 6 & JNDI bindings: overriding the module name

    vincent_aumont

      Hi,

       

      I have this bean:

       

      {code}

      @stateless

      public class MyBean{

       

      [...]

      }

      {code}

       

      packaged in a jar that it itself packaged in a war (mywar-1.0.0-SNAPSHOT.war).

       

      When I deploy this war, AS binds the bean to java:module/MyBean and java:global/myapp-1.0.0-SNAPSHOT/MyBean.

      So far so good, but I'd like to map the bean in the global scope as java:global/myapp/MyBean

       

      I thought that the spec-compliant way to do this was to set the application's root context.

      So, My jboss-web.xml looks like this:

       

      {code}

      <jboss-web>

        <context-root>/myapp</context-root>

      </jboss-web>

      {code}

       

      But it does not work, the bean is still bound to java:global/myapp-1.0.0-SNAPSHOT/MyBean.

       

      (it works on Glassfish 3.1, though)

       

      What is the proper way to change the module name in the java:global/<module-name>/<bean name> jndi name?

       

      Thanks,

       

      Vincent