Reputation: 61
In a JAX-WS SE class I have a field in wich I inject a @Resource
to finally get the client's IP address. All is ok until I make this SE a CDI managed bean
@WebService
public class AImpl implements A {
@Resource
private WebServiceContext wsContext;
@Inject
private ADelegated delegated;
...
}
I deploy this app in a WebLogic 12c and I get this error
java.lang.IllegalArgumentException: Can not set javax.xml.ws.WebServiceContext field AImpl.wsContext to weblogic.jndi.internal.WLEventContextImpl
What is incorrect in my code?
Thanks in advance for your help.
Upvotes: 2
Views: 2810
Reputation: 61
I found the solution (with the help of Oracle forums people).
With the addition of the attribute 'name' to the @Resource annotation the problem was solved:
@WebService
public class AImpl implements A {
@Resource(name="wsContext")
private WebServiceContext wsContext;
@Inject
private ADelegated delegated;
...
}
Upvotes: 2
Reputation: 5378
JAX-WS doesn't have any CDI integration to my knowledge. What it seems like is happening is CDI is creating your bean instead of JAX-WS and the injections are getting mixed up.
Upvotes: 2