2 Replies Latest reply on Dec 2, 2007 6:20 AM by Magnus Sandberg

    java:com/env not working?

    Magnus Sandberg Novice

      Hi,

      I'm trying to look up a Bean using java:comp/env/MyBean but I just keep getting "env not bound" (using jbossAS 4.2.1.GA)

      Isn't java:comp/env/ supported for looking up Bean in the local namespace?

      Thanks

      /Magnus

        • 1. Re: java:com/env not working?
          wayne baylor Apprentice

          yep, but you have to put it there first :) you can use ejb-jar.xml and jboss.xml to accomplish this.

          ejb-jar.xml defines the lookup string (the bold part): java:comp/env/ejb/MyBean

          jboss.xml will map this lookup string the global jndi name of the bean.

          • 2. Re: java:com/env not working?
            Magnus Sandberg Novice

            Thanks,

            but is this not possible to accomplish this with annotations?

            Currently my beans ends up in my-ear/MyBean/local (or remote) with the default behavior with simple annotations. If I want (the local) beans in java:comp/env as well I need ejb-jar.xml as well as jboss.xml?

            I cannot really find any documentations on this - if you could give my an example I'd be very happy.

            Thanks