I hava a Metro jax-ws webservice that looks more or less like this:
@WebService
@Transactional
public class UserManagementServiceImpl {
@Resource
private WebServiceContext context;
...
}
The WebServiceContext
is allways null. However, if I remove @Transactional
the WebServiceContext is injected.
Anybody knows a workaround?
Thanks.
I've found a workaround. Use setter injection instead of field injection:
@WebService
@Transactional
public class UserManagementServiceImpl {
private WebServiceContext context;
@Resource
public void setContext(WebServiceContext context) {
this.context = context;
}
...
}