Hi, I had the same problem using JBoss 4.2.3 and JBossWS 3.1.1
I have resolved it via such work around placed in my Interceptor:

  |         /**
  |      * Returns true if current context has a webservice context available. 
This
  |      * method is a workaround for not working injection of the 
WebServiceContext
  |      * via Resource annotation.
  |      *
  |      * @param ctx InvocationContext
  |      * @return true if WebServiceContext is available, false otherwise.
  |      */
  |     private boolean isWebServiceContext(InvocationContext ctx) {
  |             try {
  |                     WebServiceContext wsc = null;
  |                     Field wrapped = 
ctx.getClass().getDeclaredField("wrapped");
  |                     if (wrapped != null) {
  |                             wrapped.setAccessible(true);
  |                             Object sbctx = wrapped.get(ctx);
  |                             if (sbctx != null) {
  |                                     Field ctxField = 
sbctx.getClass().getDeclaredField("ctx");
  |                                     if (ctxField != null) {
  |                                             ctxField.setAccessible(true);
  |                                             Object context = 
ctxField.get(sbctx);
  |                                             if (context != null) {
  |                                                     Field webServiceCtx = 
context.getClass().getDeclaredField("webServiceContext");
  |                                                     if (webServiceCtx != 
null) {
  |                                                             
webServiceCtx.setAccessible(true);
  |                                                             wsc = 
(WebServiceContext) webServiceCtx.get(context);
  |                                                             return wsc != 
null;
  |                                                     }
  |                                             }
  |                                     }
  |                             }
  |                     }
  |             } catch (NoSuchFieldException e) {
  |                     // silent
  |             } catch (IllegalArgumentException e) {
  |                     // silent
  |             } catch (IllegalAccessException e) {
  |                     // silent
  |             }
  |             return false;
  |     }
  | 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4243663#4243663

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4243663
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to