JBoss Community

@EJB not injected when using JBossWS-metro

created by Markus KilÄs in JBoss Web Services - View the full discussion

After switching from JBossWS-native in JBoss 5.1.0.GA-jdk6 to JBossWS-metro-3.3.1 my servlet endpoint no longer get the EJBs injected. This worked fine with JBossWS-native (and also in GlassFish) but not after changing to jbossws-metro.

 

The servlet endpoint is implemented as below:

 

@WebService(serviceName = "MyService", portName = "MyServicePort", endpointInterface = "com.example.server.MyService", targetNamespace = "http://myservice.server.example.com/", wsdlLocation = "WEB-INF/wsdl/MyService/MyService.wsdl")
public class MyService {
    @EJB
    private FirstSessionLocal first;
    @EJB
    private SecondSessionLocal second;
    @Resource
    private WebServiceContext wsContext;

    public void business() {
    LOG.debug(">business");
    if (first == null) LOG.error("first not injected");
    if (second == null) LOG.error("second not injected");
    if (wsContext == null) LOG.error("wsContext not injected");
    }
}

 

 

Is this a known issue? What could be the problem? Any workaround?

Reply to this message by going to Community

Start a new discussion in JBoss Web Services at Community