I'm getting an exception while trying to inject a webservice that's completely separate from my JVM.
My environment is TomEE v1.0.0, which is a JEE6 webprofile container.
ThemeQueryService is a JAXWS annotated interface.
@SessionScoped
@Named("managedBeanMB")
public class ManagedBeanMB implements Serializable {
private static final long serialVersionUID = 1L;
@WebServiceRef(
wsdlLocation = "http://localhost:8777/services/queryService?wsdl")
private QueryService queryService;
....
}
Later on, I get an NPE when trying to use the injected service:
Caused by: java.lang.NullPointerException
at org.apache.openejb.core.ivm.naming.JaxWsServiceReference.getObject(JaxWsServiceReference.java:73)
at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:173)
at org.apache.openejb.cdi.CdiResourceInjectionService.lookup(CdiResourceInjectionService.java:134)
at org.apache.openejb.cdi.CdiResourceInjectionService.fillInjectionProperties(CdiResourceInjectionService.java:112)
at org.apache.openejb.cdi.CdiResourceInjectionService.injectJavaEEResources(CdiResourceInjectionService.java:96)
at org.apache.webbeans.component.AbstractInjectionTargetBean.injectResources(AbstractInjectionTargetBean.java:432)
at org.apache.webbeans.portable.creation.InjectionTargetProducer.inject(InjectionTargetProducer.java:91)
at org.apache.webbeans.component.InjectionTargetWrapper.inject(InjectionTargetWrapper.java:79)
at org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:182)
I get the feeling I don't understand WebServiceRef... Is it used for JNDI transport only?
You have to use TomEE+, not the TomEE (webprofile).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.