diff --git a/wsit/ws-sx/wssx-impl/src/main/java/com/sun/xml/wss/util/ServletContextUtil.java b/wsit/ws-sx/wssx-impl/src/main/java/com/sun/xml/wss/util/ServletContextUtil.java index df45c5265..c8ba1a97b 100644 --- a/wsit/ws-sx/wssx-impl/src/main/java/com/sun/xml/wss/util/ServletContextUtil.java +++ b/wsit/ws-sx/wssx-impl/src/main/java/com/sun/xml/wss/util/ServletContextUtil.java @@ -50,11 +50,16 @@ public static WSSServletContextFacade wrap(Object context) { if (context == null) { return null; } + + if(context instanceof WSSServletContextFacade) { + return (WSSServletContextFacade) context; + } + Class servletContextClass = findServletContextClass(); if (servletContextClass == null) { return null; } - if (servletContextClass.isInstance(servletContextClass)) { + if (servletContextClass.isInstance(context)) { return new WSSServletContextFacade(context); } return null;