1 Reply Latest reply on Sep 27, 2001 9:21 AM by doug

    cannot access env-entry settings

    doug

      Hi,

      I'm having trouble accessing properties set in ejb-jar.xml using <env-entry>.

      The ejb-jar looks like this...


      Sample Entity EJB
      <ejb-name>Entity</ejb-name>
      test.entity.EntityHome
      test.entity.Entity
      <ejb-class>test.entity.EntityEJB</ejb-class>
      <persistence-type>Bean</persistence-type>
      False
      <env-entry>
      <env-entry-name>test/TestValue</env-entry-name>
      <env-entry-type>java.lang.String</env-entry-type>
      <env-entry-value>Test data</env-entry-value>
      </env-entry>


      From my code I try to access it using the following...

      InitialContext ic = new InitialContext();
      String str =
      (String)ic.lookup("java:/test/TestValue");

      ... but it complains that it cannot be found. Also, If I do a dump of the Context, it definately isn't defined.

      Is this a common problem? Do I need to add anything to jboss.xml to get it to be bound? Can anyone help? I'm running Tomcat 2.4.1 on Windows 98.

      thnx,
      Doug

        • 1. Re: cannot access env-entry settings
          doug

          Hmmm...

          I seem to have have solved the problem by looking up "java:comp/env/test/TestValue" instead of "java:/test/TestValue". I could have sworn I'd tried this one already and it didn't work.

          Strange ... (or careless).

          D