JNDI and application environment entries

Discussions

EJB design: JNDI and application environment entries

  1. JNDI and application environment entries (1 messages)

    Hello

    I am familiar with EJBS and the ENC, whereby Environment entries defined within the deployment descriptor can only be seen by the bean in question.

    Thus, when I perfrom the following outside of the EJB (say from a seperate client PC JVM, the environment entry cannot be found.

    Context ctx = new InitialContext();
    String path = (String) ctx.lookup("java:comp/myentry");


    1) How can ?I set up environment entries that can be seen to the "entire application". Where is this done?

    Thanks

    Paddy
  2. Hello

    >
    > I am familiar with EJBS and the ENC, whereby Environment entries defined within the deployment descriptor can only be seen by the bean in question.
    >
    > Thus, when I perfrom the following outside of the EJB (say from a seperate client PC JVM, the environment entry cannot be found.
    >
    > Context ctx = new InitialContext();
    > String path = (String) ctx.lookup("java:comp/myentry");
    >
    >
    > 1) How can ?I set up environment entries that can be seen to the "entire application". Where is this done?
    >
    > Thanks
    >
    > Paddy
    You should be able to lookup using appServer specific JNDI lookup. For example on weblogic, you would do the following

    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL,"t3://localhost:7001");
    Context ctx = new InitialContext(p);
    ctx.lookup(<your JNDI name>)

    where Your JNDI name is defined in weblogic specific deployment descriptor.

    Hope this helps