cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject cxf git commit: [CXF-7029]HttpAuthenticationFaultHandler cause java.lang.IllegalStateException: WRITER
Date Mon, 29 Aug 2016 10:08:18 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 6c14b437f -> 8c6b85a00


[CXF-7029]HttpAuthenticationFaultHandler cause java.lang.IllegalStateException: WRITER

(cherry picked from commit cacfe5c39b1c28c61d8a5ccb1754f5b89109c0b7)


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8c6b85a0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8c6b85a0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8c6b85a0

Branch: refs/heads/3.1.x-fixes
Commit: 8c6b85a005984604360ba8c770a0850b67e83955
Parents: 6c14b43
Author: Freeman Fang <freeman.fang@gmail.com>
Authored: Mon Aug 29 18:07:20 2016 +0800
Committer: Freeman Fang <freeman.fang@gmail.com>
Committed: Mon Aug 29 18:08:05 2016 +0800

----------------------------------------------------------------------
 .../cxf/transport/http/HttpAuthenticationFaultHandler.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/8c6b85a0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HttpAuthenticationFaultHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HttpAuthenticationFaultHandler.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HttpAuthenticationFaultHandler.java
index 3167669..3dc2ac1 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HttpAuthenticationFaultHandler.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HttpAuthenticationFaultHandler.java
@@ -56,8 +56,9 @@ public class HttpAuthenticationFaultHandler extends AbstractPhaseInterceptor<Mes
             resp.setHeader("WWW-Authenticate", authenticationType + " realm=\"" + realm +
"\"");
             resp.setContentType("text/plain");
             try {
-                resp.getWriter().write(ex.getMessage());
-                resp.getWriter().flush();
+                resp.getOutputStream().write(ex.getMessage().getBytes());
+                resp.getOutputStream().flush();
+                message.getInterceptorChain().setFaultObserver(null); //avoid return soap
fault
                 message.getInterceptorChain().abort();
             } catch (IOException e) {
                 // TODO
@@ -72,4 +73,5 @@ public class HttpAuthenticationFaultHandler extends AbstractPhaseInterceptor<Mes
     public void setRealm(String realm) {
         this.realm = realm;
     }
+    
 }


Mime
View raw message