users@glassfish.java.net

Glassfish making WS available before resolving/injection all the dependencies

From: Paulo Cesar Reis <casmeiron_at_gmail.com>
Date: Mon, 04 May 2009 14:55:36 -0300

Hi all,

Last week I faced this problem two times. Iıll try to explain the scenario
in few words:

Imagine that I have the follow WS:

@WebService
public class MyWebservice {
    
  @EJB
  private MyEjb ejb;

    @WebMethod
     public String execEjb( ) {
        return ejb.say();
    }
}

@Local
@Remote
@Stateless
public class MyEjb {
    public String say( ) {
        return ³Hi Glassfish Users Mail List²;
   }
}

And I have another webservice that is trying to send messages to
MyWebservice WS but this one is not deployed yet.
When I start the deploy process of MyWebservice itıs seems that Glassfish
make my it available before resolving the field ejb, throwing
NullPointerException whether is being accessed before the ³full deploy
process time². In my point of view, the WebService should be available only
after all the dependencies are resolved.

I hope I made myself clear enough.

Thanks.