0

How can I initialize my loggers and property readers after the JAX-WS initialization?

I tried this but did not work. Am I missing something? My goal is to initialize everything that my webservice needs after deployment. Is this possible? Thanks

public class ContextListener implements ServletContextListener{

    @Override
    public void contextDestroyed(ServletContextEvent arg0) {
        // TODO Auto-generated method stub

    }

    @Override
    public void contextInitialized(ServletContextEvent arg0) {
        // TODO Auto-generated method stub
            System.out.println("Initialize some things");
    }

}

PS I used the @WebService annotation approach in creating my WS.

River
  • 8,585
  • 14
  • 54
  • 67
Philip Morris
  • 459
  • 1
  • 9
  • 26
  • you can use [interceptors](http://cxf.apache.org/docs/interceptors.html) – Sampada Jun 22 '16 at 11:07
  • The JAX-WS spec supports the `@PostConstruct` annotation (like most other managed objects in the container). Using this, you can perform your initialization actions in an `@WebService`. see also: http://stackoverflow.com/questions/3406555/why-use-postconstruct – kolossus Jun 22 '16 at 13:42

0 Answers0