2 Replies Latest reply on Feb 2, 2007 3:24 AM by putopuntocom

    trying to get the language from de jndi context in EJB3SLSB

    putopuntocom

      I'm creating a context for accessing a Stateless EJB3.

      String JNDI_FACTORY = "org.jboss.security.jndi.JndiLoginInitialContextFactory";
       String JNDI_PROVIDER_URL = "jnp://localhost";
       String JNDI_PROVIDER_PORT = "1099";
      
       Properties prop = new Properties();
       prop.put( Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY );
       prop.put( Context.PROVIDER_URL, JNDI_PROVIDER_URL + ":"
       + JNDI_PROVIDER_PORT );
      
       prop.put( Context.LANGUAGE, "ca");
       prop.put( Context.SECURITY_PRINCIPAL, "test1");
       prop.put( Context.SECURITY_CREDENTIALS, "test1");
      
      
       InitialContext ctx = new InitialContext(prop);


      Then I make the lookup and everythings works ok.

      The quiz is:
      How can I access to the Context.LANGUAGE from EJB3?.

      I've tried:
      - new InitialContext().getEnvironment()
      - new InitialContext().lookup(Context.LANGUAGE)


      And this property doesn't exist.