1 Reply Latest reply on Feb 14, 2006 6:24 PM by fabcipriano

    How to access the ejb environment?

    heinrich

      Hi,

      i just trying to access the environment of a client (swing) that is calling a session bean.
      The client has a property "locale" set in which the current language is stored.
      I have to read this language in the session bean.
      In ejb2.1 this was possible using the sessioncontext

      context.getEnvironment().getProperty("locale");
      


      I'm using Jboss 4.0.4SP1 with EJB RC5.

      The api of the SessionContext says, that this is now deprecated and i should use java:comp/env instead.
      How can i solve this?
      I tried:
       InitialContext ini = new InitialContext();
       NamingContext o = (NamingContext) ini.lookup("java:comp/env");
      


      But this will throw an NameNotBoundException.

      Is there a manual for that?

      Thanks for your help


      Martin