EJB programming & troubleshooting: How can I get infomation deployed in the ejb env-entry

  1. Hi,everyone!

    I have develop a ejb , and I have some infomation deployed in the ejb deployment description as follows,
          <description />

    I have tried to use the SessionContext.getEnvironment() to get these infomations , but I failed, Are there some body can help me ?

    Thanks ahead !
  2. Hi,

     You can read this env-entry using this code

    Context ctx = new InitialContext();
    String val = (String)ctx.lookup("java:comp/env/SERVICE_1");


  3. Thank you very much ,It seems to be that SessionContext.getEnvironment is deprived in ejb2.0 and replaced by the way you prive to me .