Jax-ws on glassfish3 init method?

JAX-WS endpoints, both web and EJB, can have optional life-cycle methods that are automatically called if present. Any method can be used as a life-cycle method with the correct annotation.

How can I configure init method for jaxws service (like I can do for the servlets for example) JAX-WS endpoints, both web and EJB, can have optional life-cycle methods that are automatically called if present. Any method can be used as a life-cycle method with the correct annotation: @PostConstruct - Called by the container before the implementing class begins responding to web service clients. @PreDestroy - Called by the container before the endpoint is removed from operation So annotating your init() method with @PostConstruct should do the trick.

The load on startup parameter is not affecting the service, I see that for every request init function called again Try to use the suggested annotation first. And if you are still facing unexpected behavior, post your code.

Thanks for the quick answer, Pascal. BTW, I warmly suggest to use a "valid" servlet 2.5 or servlet 3.0 web. Xml (using a version attribute in the web-app element and the xsd declaration).

I'm using 2.5 version, I just didn't paste this part in my post WebTier for the Login Manager Service LoginManagerWAR Endpoint for Login Manager Web Service LoginManagerControllerService LoginManagerController loginmanager.controller. LoginManagerController 1 LoginManagerController /LoginManagerControllerService 54 The PostConstruct works fine , thank you, but load-on-startup still didn't happen. @WebService( name="LoginManagerController", serviceName="LoginManagerControllerService" ) public class LoginManagerController { private ILoginManager manager; @Resource private WebServiceContext wsContext; @PostConstruct private void init(){ ..... } More over, now every client request makes 2 init() calls of the webservice: like I can see in chainsaw, first called init() of the service, then it called again and then the actually client's function (I print the hash code of the webservice class instance and it the same instance for both calls!): > Message Inside init() method ... controller=31641446 > Message login manager = 11229828 > .....init of elements....blablabla..... > Message Exiting init() method > Message Inside init() method ... controller=31641446 > Message login manager = 32361523 The controller is the service and the manager (wich hash code has been changed from first call to the second) created inside the init () of the controller.

I failed to understand what is wrong .... UPDATE It seems like a to glassfish v3 related issue (maybe my env setup or glassfish configuration). I tried this war on Sailfin and Glassfish V2 and its perfectly working ....

If you think there is a bug in v3, please complete the circle by filing an issue @ glassfish.dev.java. Net/servlets/ProjectIssues – vkraemer Apr 3 '10 at 15:24.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions