[jboss-user] [Beginners Corner] - web service life cycle

jahhaj do-not-reply at jboss.com
Wed Jul 16 07:01:46 EDT 2008


I have a web service written using JAX-WS. It's deployed as a war file (does that matter? I could change if it does). The @WebService annotated class has some data fields which need one-time initialization.

My first attempt to do this was in the constructor but I soon realised that the constructor is invoked every time a service method is invoked (twice actually). So I started reading and the @PostConstruct annotation seems to do what I want. However my method annotated with @PostConstruct is never called (it's a public void method with no parameters).

What's the right method to do this? And why does @PostConstruct not seem to work?

Thanks


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164715#4164715

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164715



More information about the jboss-user mailing list