[jboss-user] [JBossWS] - webservice class injecting EJB, nullpointerexception
HTroeng
do-not-reply at jboss.com
Mon Jan 14 11:14:52 EST 2008
Shouldn't it be possible to inject an EJB into a jax-ws webservice class? I get a nullpointerexception when trying to use the EJB, it doesn't look like the ejb is injected into the webservice class?
Code:
Interface:
@WebService
public interface MyService {
public String echoService(String input);
}
Implementation:
@WebService(endpointInterface = "my.package.MyService")
@SOAPBinding(style = Style.RPC)
public class MyServiceImpl implements MyService {
@EJB
SurveillanceService surveillanceService;
@WebMethod(operationName="echoService")
public String echoService(String input) {
boolean isAvail = surveillanceService.isDatabaseAvailable();
return "Hi " + input + ", result from ejb: " + isAvail;
}
}
The EJB does work (confirmed, I use it in other places), It seems that it is something with the Webservice > EJB...
Thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119706#4119706
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119706
More information about the jboss-user
mailing list