My JAX-WS war contains following entries.
WEB-INF/lib/
WEB-INF/beans.xml // empty
WEB-INF/lib/commons-logging-1.1.1.jar
WEB-INF/lib/corrs-beans-1.0-alpha-1-SNAPSHOT.jar // EJBs are here
WEB-INF/lib/corrs-entities-1.0-alpha-1-SNAPSHOT.jar
WEB-INF/lib/joda-time-1.6.2.jar
WEB-INF/lib/opensaml-2.5.1-1.jar
WEB-INF/lib/openws-1.4.2-1.jar
WEB-INF/lib/slf4j-api-1.6.1.jar
WEB-INF/lib/wss4j-1.6.8.jar
WEB-INF/lib/xmlsec-1.5.3.jar
WEB-INF/lib/xmltooling-1.3.2-1.jar
WEB-INF/web.xml
META-INF/maven/
META-INF/maven/kr.co.ticomms.corrs/
META-INF/maven/kr.co.ticomms.corrs/corrs-services/
META-INF/maven/kr.co.ticomms.corrs/corrs-services/pom.xml
META-INF/maven/kr.co.ticomms.corrs/corrs-services/pom.properties
One of my SOAPHandlers trying to call EJB.
@HandlerChain(file=...)
@WebService(...)
public class MyService {
}
public class MyHandler implements SOAPHandler<SOAPMessageContext> {
@Override
public boolean handleMessage(final SOAPMessageContext context) {
// MyEJB null
}
@Inject
private MyEJB myEJB; // << NULL
}
MyEJB is just an nointerface-view EJB.
@LocalBean
@Stateless
public class MyEJB {
}
Can anybody please tell me how to inject EJBs into SOAPHandlers?
UPDATE / (maybe)ANSWER
I changed @Inject
to @EJB
and it works.
Is there any way to work with @Inject
? I looks IMHO better. :)
@Resource
annotation injection in the handler lifecycle. – Vengeance