1 Reply Latest reply on May 31, 2006 11:25 AM by William DeCoste

    client and @EJB

    heapifyman heapifyman Newbie


      In the sun ejb3.0 spec (ejbcore, final release) on page 44, chapter 3.4.1 "Obtaining a Session Bean?s Business Interface" it is stated, that a client can obtain the session bean's interface via the @EJB annotation.
      Further, it states, that this should work regardless of whether it's a remote or local interface. On the pages before that it is said that a client can be local or remote.
      So, I may have misunderstood this, but for me this sounds as if i can deploy some session bean on an app-server (say Jboss) and then obtain the bean's interface simply by putting something like this in my client java class:

      @EJB private Converter converter
      (from the converter-app example of the sun j2ee 5 tutorial).

      Unfortunately, when I try to to this with Jboss, my SessionBean get's deployed just fine but whenever I try to execute the Client class it fails with a NullPointerException because converter is null.

      So, to cut a long story short, does this injection thing only work, if the client is running inside the server as well? And of what use is it then?