4 Replies Latest reply on Oct 27, 2005 9:34 AM by maxs

    JNDI context

    maxs

      Hi,

      How can I bind a context (e.g. mycontext) to JBoss JNDI tree?

      Thank you,
      Maxim

        • 1. Re: JNDI context

          Retrieve the initial context (or any other context) and add your subcontext to it.

          Context ctx = new InitialContext();
          Context newCtx = ctx.createSubcontext(newCtxName);

          • 2. Re: JNDI context
            maxs

            I added the following to jboss-service.xml and it works fine.

            Is it correct?


            mycontext
            javax.naming.InitialContext

            • 3. Re: JNDI context
              maxs


              anfynet2
              javax.naming.InitialContext

              • 4. Re: JNDI context
                maxs

                mbean code="org.jboss.naming.ExternalContext" name="DefaultDomain:service=ExternalContext,jndiName=mycontext"
                attribute name="JndiName">mycontext attribute
                attribute name="InitialContext">javax.naming.InitialContext attribute
                mbea