cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject git commit: [CXF-5546] NPE may be thrown and logged during WS-RM's retransmission
Date Fri, 14 Mar 2014 15:05:05 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 4a66aecad -> 63cdec167


[CXF-5546] NPE may be thrown and logged during WS-RM's retransmission

git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1565162 13f79535-47bb-0310-9956-ffa450edef68


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

Branch: refs/heads/2.7.x-fixes
Commit: 63cdec167f458747173540c749265ca034bcf4b8
Parents: 4a66aec
Author: Akitoshi Yoshida <ay@apache.org>
Authored: Thu Feb 6 10:57:51 2014 +0000
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Fri Mar 14 16:04:53 2014 +0100

----------------------------------------------------------------------
 .../cxf/ws/rm/soap/RetransmissionQueueImpl.java | 27 ++++++++------------
 1 file changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/63cdec16/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
index 586ca52..eaed232 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RetransmissionQueueImpl.java
@@ -19,13 +19,11 @@
 
 package org.apache.cxf.ws.rm.soap;
 
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.ConnectException;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
@@ -385,7 +383,7 @@ public class RetransmissionQueueImpl implements RetransmissionQueue {
         }
         
         final String address = to.getValue();
-        LOG.fine("Resending to address: " + address);
+        LOG.log(Level.FINE, "Resending to address: {0}", address);
         final ProtocolVariation protocol = RMContextUtils.getProtocolVariation(message);
         final Endpoint reliableEndpoint = manager.getReliableEndpoint(message).getEndpoint(protocol);
 
@@ -450,15 +448,10 @@ public class RetransmissionQueueImpl implements RetransmissionQueue
{
             }
             CachedOutputStream content = (CachedOutputStream)message
                 .get(RMMessageConstants.SAVED_CONTENT);
-            InputStream bis = null;
             if (null == content) {
-                byte[] savedbytes = message.getContent(byte[].class);
-                bis = new ByteArrayInputStream(savedbytes); 
-                if (LOG.isLoggable(Level.FINE)) {
-                    LOG.fine("Using saved byte array: " + Arrays.toString(savedbytes));
-                }
+                LOG.log(Level.WARNING, "Assuming the message has been acknowledged and released,
skipping resend.");
             } else {
-                bis = content.getInputStream();
+                InputStream bis = content.getInputStream();
                 if (LOG.isLoggable(Level.FINE)) {
                     if (content.size() < 65536) {
                         LOG.fine("Using saved output stream: " 
@@ -467,17 +460,17 @@ public class RetransmissionQueueImpl implements RetransmissionQueue
{
                         LOG.fine("Using saved output stream: ...");                     
  
                     }
                 }
-            }
 
-            // copy saved output stream to new output stream in chunks of 1024
-            IOUtils.copyAndCloseInput(bis, os);
-            os.flush();
-            // closing the conduit this way will close the underlining stream that is os.
-            c.close(message);
+                // copy saved output stream to new output stream in chunks of 1024
+                IOUtils.copyAndCloseInput(bis, os);
+                os.flush();
+                // closing the conduit this way will close the underlining stream that is
os.
+                c.close(message);
+            }
         } catch (ConnectException ex) {
             //ignore, we'll just resent again later
         } catch (IOException ex) {
-            LOG.log(Level.SEVERE, "RESEND_FAILED_MSG", ex);
+            LOG.log(Level.WARNING, "RESEND_FAILED_MSG", ex);
         }
     }
 


Mime
View raw message