Jim Ma [
http://community.jboss.org/people/jim.ma] created the discussion
"Re: Load on startup is ignored - JaxWS webservice is always initialized first"
To view the discussion, visit:
http://community.jboss.org/message/617795#617795
--------------------------------------------------------------
If you do not have to call the custom initialization before the webservice constructor ,
this could help:
* call custom environment initialization in a ServletContextListener
* Get servletContext from injected webServiceContext like:
@WebService
public class HelloServletImpl implements HelloServlet {
@Resource
public WebServiceContext wsContext;
public HelloServletImpl() {
System.out.println("HelloServlet is instantiated!");
}
@Override
public String newOperation(final String in) {
// TODO Auto-generated method stub
ServletContext servletContext =
(ServletContext)
wsContext.getMessageContext().get(MessageContext.SERVLET_CONTEXT);
System.out.println(servletContext.getAttribute("TEST"));
return (String)servletContext.getAttribute("TEST");
}
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/617795#617795]
Start a new discussion in JBoss AS7 Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]