users@jax-ws.java.net

WebServiceContext not being injected

From: Crampton, Eric <esc_at_amazon.com>
Date: Fri, 30 Dec 2005 14:08:38 -0800

I have some code which looks like this:

@javax.jws.WebService(endpointInterface="...omitted...")
public class MyServiceImpl {

  @javax.annotation.Resource javax.xml.ws.WebServiceContext jaxwsContext;

  public MyServiceImpl() {
    System.out.println("jaxwsContext: " + jaxwsContext);
  }

  // ...
}

The WebServiceContext isn't being injected into the class; the println always shows it as being null. My web.xml and sun-jaxws.xml files look much like the examples. I'm using JAX-WS 2.0 EA3. Any ideas why this isn't working?

I did run across a bug listed here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6342024

It says it was fixed in the SunOne app server. I'm using the Tomcat 5.0 available from Sun suitable for use with JWSDP 2.0. Not sure what that means.

Regards,
--Eric