0 Replies Latest reply on May 17, 2010 2:55 AM by Jens Mander

    Can't inject SessionContext within a webservice in JBoss 5.1?

    Jens Mander Newbie

      Hi,

       

      last week I already creaded an issue because @EJB injection (https://jira.jboss.org/browse/JBWS-3026) but now I'am struggling with the @Resource injection.

      I'd like to get the SessionContext so I can check a user role like this:

       

       

      @SOAPBinding(style = Style.RPC)
      @WebService(serviceName = "ProduktService", portName = "ProduktServicePort")
      public class ProduktServiceImpl implements ProduktService {
      
          @Resource
          SessionContext ctx;
      
          private boolean isAuth() {
               return ctx.isCallerInRole("admin");
          }
      
          ...
      }
      

       

      When I use the service I receive that stacktrace:

       

       

      08:47:47,781 ERROR [InjectionException] Resource 'ctx' not found
      javax.naming.NameNotFoundException: ctx 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:443)
          at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
          at org.jboss.wsf.common.injection.InjectionHelper.lookup(InjectionHelper.java:431)
          at org.jboss.wsf.common.injection.InjectionHelper.inject(InjectionHelper.java:413)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResourceAnnotatedAccessibleObjects(InjectionHelper.java:315)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResources(InjectionHelper.java:108)
          at org.jboss.wsf.common.invocation.InvocationHandlerJAXWS.onEndpointInstantiated(InvocationHandlerJAXWS.java:75)
          at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.getTargetBean(AbstractInvocationHandlerJSE.java:81)
          at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.invoke(AbstractInvocationHandlerJSE.java:119)
          at org.jboss.wsf.stack.cxf.AbstractInvoker._invokeInternal(AbstractInvoker.java:154)
          at org.jboss.wsf.stack.cxf.AbstractInvoker.invoke(AbstractInvoker.java:104)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
          at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
          at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
          at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
          at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98)
          at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:394)
          at org.jboss.wsf.stack.cxf.ServletControllerExt.invoke(ServletControllerExt.java:175)
          at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:61)
          at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:194)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.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(CachedConnectionValve.java:158)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          at java.lang.Thread.run(Unknown Source)
      08:47:47,781 ERROR [InjectionException] Cannot inject field annotated with @Resource annotation: javax.ejb.SessionContext de.hd.produktservice.ProduktServiceImpl.ctx
      org.jboss.wsf.common.injection.InjectionException: Resource 'ctx' not found
          at org.jboss.wsf.common.injection.InjectionException.rethrow(InjectionException.java:106)
          at org.jboss.wsf.common.injection.InjectionHelper.lookup(InjectionHelper.java:436)
          at org.jboss.wsf.common.injection.InjectionHelper.inject(InjectionHelper.java:413)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResourceAnnotatedAccessibleObjects(InjectionHelper.java:315)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResources(InjectionHelper.java:108)
          at org.jboss.wsf.common.invocation.InvocationHandlerJAXWS.onEndpointInstantiated(InvocationHandlerJAXWS.java:75)
          at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.getTargetBean(AbstractInvocationHandlerJSE.java:81)
          at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.invoke(AbstractInvocationHandlerJSE.java:119)
          at org.jboss.wsf.stack.cxf.AbstractInvoker._invokeInternal(AbstractInvoker.java:154)
          at org.jboss.wsf.stack.cxf.AbstractInvoker.invoke(AbstractInvoker.java:104)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
          at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
          at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
          at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
          at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98)
          at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:394)
          at org.jboss.wsf.stack.cxf.ServletControllerExt.invoke(ServletControllerExt.java:175)
          at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:61)
          at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:194)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.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(CachedConnectionValve.java:158)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          at java.lang.Thread.run(Unknown Source)
      Caused by: javax.naming.NameNotFoundException: ctx 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:443)
          at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
          at org.jboss.wsf.common.injection.InjectionHelper.lookup(InjectionHelper.java:431)
          ... 46 more
      08:47:47,796 ERROR [InvocationHandlerJAXWS] Method invocation failed with exception: Cannot create endpoint instance: 
      java.lang.IllegalStateException: Cannot create endpoint instance: 
          at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.getTargetBean(AbstractInvocationHandlerJSE.java:85)
          at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.invoke(AbstractInvocationHandlerJSE.java:119)
          at org.jboss.wsf.stack.cxf.AbstractInvoker._invokeInternal(AbstractInvoker.java:154)
          at org.jboss.wsf.stack.cxf.AbstractInvoker.invoke(AbstractInvoker.java:104)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
          at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
          at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
          at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
          at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98)
          at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:394)
          at org.jboss.wsf.stack.cxf.ServletControllerExt.invoke(ServletControllerExt.java:175)
          at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:61)
          at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:194)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.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(CachedConnectionValve.java:158)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          at java.lang.Thread.run(Unknown Source)
      Caused by: org.jboss.wsf.common.injection.InjectionException: Cannot inject field annotated with @Resource annotation: javax.ejb.SessionContext de.hd.produktservice.ProduktServiceImpl.ctx
          at org.jboss.wsf.common.injection.InjectionException.rethrow(InjectionException.java:106)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResourceAnnotatedAccessibleObjects(InjectionHelper.java:320)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResources(InjectionHelper.java:108)
          at org.jboss.wsf.common.invocation.InvocationHandlerJAXWS.onEndpointInstantiated(InvocationHandlerJAXWS.java:75)
          at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.getTargetBean(AbstractInvocationHandlerJSE.java:81)
          ... 41 more
      Caused by: org.jboss.wsf.common.injection.InjectionException: Resource 'ctx' not found
          at org.jboss.wsf.common.injection.InjectionException.rethrow(InjectionException.java:106)
          at org.jboss.wsf.common.injection.InjectionHelper.lookup(InjectionHelper.java:436)
          at org.jboss.wsf.common.injection.InjectionHelper.inject(InjectionHelper.java:413)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResourceAnnotatedAccessibleObjects(InjectionHelper.java:315)
          ... 44 more
      Caused by: javax.naming.NameNotFoundException: ctx 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:443)
          at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
          at org.jboss.wsf.common.injection.InjectionHelper.lookup(InjectionHelper.java:431)
          ... 46 more
      08:47:47,812 WARNING [PhaseInterceptorChain] Application has thrown exception, unwinding now
      org.apache.cxf.interceptor.Fault: Cannot create endpoint instance: 
          at org.jboss.wsf.stack.cxf.AbstractInvoker.createFault(AbstractInvoker.java:209)
          at org.jboss.wsf.stack.cxf.AbstractInvoker._invokeInternal(AbstractInvoker.java:180)
          at org.jboss.wsf.stack.cxf.AbstractInvoker.invoke(AbstractInvoker.java:104)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
          at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
          at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
          at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
          at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
          at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98)
          at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:394)
          at org.jboss.wsf.stack.cxf.ServletControllerExt.invoke(ServletControllerExt.java:175)
          at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:61)
          at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:194)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
          at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.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(CachedConnectionValve.java:158)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.IllegalStateException: Cannot create endpoint instance: 
          at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.getTargetBean(AbstractInvocationHandlerJSE.java:85)
          at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.invoke(AbstractInvocationHandlerJSE.java:119)
          at org.jboss.wsf.stack.cxf.AbstractInvoker._invokeInternal(AbstractInvoker.java:154)
          ... 39 more
      Caused by: org.jboss.wsf.common.injection.InjectionException: Cannot inject field annotated with @Resource annotation: javax.ejb.SessionContext de.hd.produktservice.ProduktServiceImpl.ctx
          at org.jboss.wsf.common.injection.InjectionException.rethrow(InjectionException.java:106)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResourceAnnotatedAccessibleObjects(InjectionHelper.java:320)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResources(InjectionHelper.java:108)
          at org.jboss.wsf.common.invocation.InvocationHandlerJAXWS.onEndpointInstantiated(InvocationHandlerJAXWS.java:75)
          at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.getTargetBean(AbstractInvocationHandlerJSE.java:81)
          ... 41 more
      Caused by: org.jboss.wsf.common.injection.InjectionException: Resource 'ctx' not found
          at org.jboss.wsf.common.injection.InjectionException.rethrow(InjectionException.java:106)
          at org.jboss.wsf.common.injection.InjectionHelper.lookup(InjectionHelper.java:436)
          at org.jboss.wsf.common.injection.InjectionHelper.inject(InjectionHelper.java:413)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResourceAnnotatedAccessibleObjects(InjectionHelper.java:315)
          ... 44 more
      Caused by: javax.naming.NameNotFoundException: ctx 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:443)
          at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
          at org.jboss.wsf.common.injection.InjectionHelper.lookup(InjectionHelper.java:431)
          ... 46 more
      
      

       

      Do I have to use the mappedName-attribute? But which name do I have to choose?