[jboss-user] [JBoss Web Services] - CDI @Inject in a JAX-WS service impl?

Paul Robinson do-not-reply at jboss.com
Tue Feb 14 12:54:13 EST 2012


Paul Robinson [https://community.jboss.org/people/paul.robinson] created the discussion

"CDI @Inject in a JAX-WS service impl?"

To view the discussion, visit: https://community.jboss.org/message/716601#716601

--------------------------------------------------------------
Hello,

I have a JAX-WS service implementation class, that tries to @Inject a bean. The bean does not seem to be injected. If I change the Web service impl to be a stateless session bean, the @Inject is done.

Here's my code, in which the inject is not done:

@WebService(serviceName = "EchoServiceService", portName = "EchoServicePort",
        name = "EchoServiceImpl", targetNamespace = "http://my.org/simple")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class EchoServiceImpl implements IEchoService
{
     @Inject
    HelloBean hello;
 
    @WebMethod
    public String sayHello(String msg) throws MyException
    {
        //throws a NPE:
        return hello.sayHello(msg);
    }
}


Is this a known limitation of JBossWS, or am I missing something?

Thanks,

Paul.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/716601#716601]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120214/d495db53/attachment.html 


More information about the jboss-user mailing list