[jbossws-dev] Resource still not injected in JAX-WS handler for EJB3 WS in JBossWS 3.1.1 deployed in Jboss 5.0.0.GA

Yang, Gang CTR USA gang.yang at us.army.mil
Tue Apr 21 17:42:05 EDT 2009


Hi,

I deployed the JBossWS 3.1.1 into Jboss 5.0.0.GA and ran my two tests
for JAX-WS handler with two simple WebService endpoints, one Web-based
and one EJB3-based. The resource injection in the handler for the
Web-based WS endpoint worked (it did not work for earlier JBossWS
release), but the resource injection in the handler (the same class) for
the EJB3-based WS endpoint did not work. Here's some more details:

1. The same handler code was used for both tests. The handler jar was
copied into $JBOSS_HOME/lib/endorsed for sharing.
2. For the EJB3-based WS endpoint, Jboss threw the following exception
that seem to indicate that the java:comp/env was not bound:

---
16:50:37,000 WARN  [JavaxAnnotationHelper] Cannot inject @Resource
annotated field: private java.lang.String
test.handler.TestServerHandler.configFile
javax.naming.NameNotFoundException: env not bound
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
        at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
        at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
        at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
        at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:820)
        at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:673)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at
org.jboss.wsf.common.javax.JavaxAnnotationHelper.inject(JavaxAnnotationH
elper.java:284)
        at
org.jboss.wsf.common.javax.JavaxAnnotationHelper.injectResources(JavaxAn
notationHelper.java:148)
        at
org.jboss.ws.core.jaxws.handler.HandlerResolverImpl.addHandler(HandlerRe
solverImpl.java:171)
        at
org.jboss.ws.core.jaxws.handler.HandlerResolverImpl.initHandlerChain(Han
dlerResolverImpl.java:149)
        at
org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callRequestHandlerC
hain(HandlerDelegateJAXWS.java:88)
        at
org.jboss.ws.core.server.ServiceEndpointInvoker.callRequestHandlerChain(
ServiceEndpointInvoker.java:125)
        at
org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointIn
voker.java:172)
        at
org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandle
rImpl.java:474)
        at
org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandler
Impl.java:295)
        at
org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.ja
va:205)
        at
org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHan
dlerImpl.java:131)
        at
org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEnd
pointServlet.java:85)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:206)
        at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte
r.java:96)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:235)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:235)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:191)
        at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAs
sociationValve.java:190)
        at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.j
ava:92)
        at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(
SecurityContextEstablishmentValve.jav
a:126)
        at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(S
ecurityContextEstablishmentValve.java
:70)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:127)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:102)
        at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConn
ectionValve.java:158)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:3
30)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:82
8)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Http11Protocol.java:601)
        at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)
----

3. However, in JNDIView, under my EJB3 component's env namespace, it did
show the name, "configFile", I'm using to inject the resource, which is
simply a String.

4. As fact of the matter, I did inject the same resource inside the EJB3
and it did work.

I tend to think that somehow the resource injection still does not work
for the case of EJB3's handler and plan to create an item in JIRA. If
anyone has more insight or suggestions, it would be appreciated.

Thanks,
Gang




More information about the jbossws-dev mailing list