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:07:40 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 071790c82 -> cacfe5c39


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


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

Branch: refs/heads/master
Commit: cacfe5c39b1c28c61d8a5ccb1754f5b89109c0b7
Parents: 071790c
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:07:20 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/cacfe5c3/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