Discussions

EJB programming & troubleshooting: Environment Entries

  1. Environment Entries (3 messages)

    Hey everybody,

    i just need some help.

    i want to add some environment entries to my ejb.
    i added the tags to the ejb-jar.xml file

    <env-entry>
      <env-entry-name>myEntry<env-entry-name>
      ...
    </env-entry>

    and deployed the ejb (in jboss 2.4).

    then i tried to lookup the environment entries from
    a remote client like this:

    Context ctx = (Context)someContext.lookup("java:comp/env");System.out.println((String)ctx.lookup("myEntry"));

    But Everytime i get a
    "javax.naming.NameNotFoundException: comp not bound"

    I can lookup the ejb itself, but no environment entry.

    What is wrong with this ???

    Thanks

    Threaded Messages (3)

  2. Environment Entries[ Go to top ]

    You can't look up environment entries from a remote client. They are only for the use of the bean they are defined with.
  3. Environment Entries[ Go to top ]

    YOU SAVED MY DAY

    THANKS
  4. Environment Entries[ Go to top ]

    Yes, that's true, the client does not have direct access to the environment entry, but there is nothing stopping you from adding a method to your EJB that accesses the ENC for the client and returns the value.

    Raff