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:09:09 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 4484cce18 -> 914115fbd


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

(cherry picked from commit cacfe5c39b1c28c61d8a5ccb1754f5b89109c0b7)
(cherry picked from commit 8c6b85a005984604360ba8c770a0850b67e83955)


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

Branch: refs/heads/3.0.x-fixes
Commit: 914115fbd3deb2552f8a3b7f5cd5c5cac81fa3a3
Parents: 4484cce
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:53 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/914115fb/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