[jboss-user] [JBoss Web Services] - problems in WebServiceContext using @Resource in web application

Deepak jangid do-not-reply at jboss.com
Tue May 22 01:37:38 EDT 2012


Deepak jangid [https://community.jboss.org/people/jangiddddd] created the discussion

"problems in WebServiceContext using @Resource in web application"

To view the discussion, visit: https://community.jboss.org/message/736944#736944

--------------------------------------------------------------
Hi 
I have some problem in web service context in web application .

Enviroument :

Jdk1.6 , Jboss5.1.0.GA ,jbossws 3.4.0

when i declare
@Resource
private WebServiceContext wsContext;  

MessageContext messageContext = wsContext.getMessageContext();
                    logger.info("--------------message context-------------"+messageContext.toString());
                    SOAPMessageContext soapMessageContext = (SOAPMessageContext) wsContext.getMessageContext();
                    SOAPMessageImpl message = (SOAPMessageImpl) soapMessageContext.getMessage();

Than this is give error after calling this endpoint



2012-05-22 10:54:57,718 ERROR org.jboss.wsf.common.invocation.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.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:241)
          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:527)
          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:316)
          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:222)
          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:147)
          at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:87)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          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.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(Thread.java:619)
Caused by: org.jboss.wsf.common.injection.InjectionException: Cannot inject field annotated with @Resource annotation: private javax.xml.ws.WebServiceContext bancmate.mbanc.action.AccountServExposeService.wsContext
          at org.jboss.wsf.common.injection.InjectionException.rethrow(InjectionException.java:106)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResourceAnnotatedAccessibleObjects(InjectionHelper.java:296)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResources(InjectionHelper.java:110)
          at org.jboss.wsf.common.invocation.InvocationHandlerJAXWS.onEndpointInstantiated(InvocationHandlerJAXWS.java:75)
          at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.getTargetBean(AbstractInvocationHandlerJSE.java:81)
          ... 28 more
Caused by: org.jboss.wsf.common.injection.InjectionException: Resource 'wsContext' not found
          at org.jboss.wsf.common.injection.InjectionException.rethrow(InjectionException.java:106)
          at org.jboss.wsf.common.injection.InjectionHelper.lookup(InjectionHelper.java:412)
          at org.jboss.wsf.common.injection.InjectionHelper.inject(InjectionHelper.java:389)
          at org.jboss.wsf.common.injection.InjectionHelper.injectResourceAnnotatedAccessibleObjects(InjectionHelper.java:291)
          ... 31 more
Caused by: javax.naming.NameNotFoundException: wsContext 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:407)
          ... 33 more
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/736944#736944]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120522/bdb04406/attachment-0001.html 


More information about the jboss-user mailing list