geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1359557 - in /geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB: GIOPConnectionThreaded.java ValueReader.java
Date Tue, 10 Jul 2012 10:00:05 GMT
Author: xiaming
Date: Tue Jul 10 10:00:05 2012
New Revision: 1359557

URL: http://svn.apache.org/viewvc?rev=1359557&view=rev
Log:
Add GIOP stream dump debug code for better problem determination

Modified:
    geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/GIOPConnectionThreaded.java
    geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/ValueReader.java

Modified: geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/GIOPConnectionThreaded.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/GIOPConnectionThreaded.java?rev=1359557&r1=1359556&r2=1359557&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/GIOPConnectionThreaded.java
(original)
+++ geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/GIOPConnectionThreaded.java
Tue Jul 10 10:00:05 2012
@@ -448,7 +448,13 @@ public final class GIOPConnectionThreade
                     processException(State.Closed, ex, false);
                     break;
                 }
-                logger.fine("Message body received "); 
+                if (logger.isLoggable(Level.FINE)) {
+                    logger.fine("Message body received ");
+                    int currentpos = buf.pos_;
+                    buf.pos_ = 0;
+                    logger.fine("Received message are: \n" + buf.dumpData());
+                    buf.pos_ = currentpos;
+                }
             }
 
             //
@@ -611,6 +617,7 @@ public final class GIOPConnectionThreade
             // Get the request timeout
             //
             int t = down.policies().requestTimeout;
+            int msgcount = 0;
 
             //
             // now we can start sending off the messages
@@ -671,11 +678,22 @@ public final class GIOPConnectionThreade
                         && !nextDown.operation().equals("_locate")) {
                     msgSentMarked = true;
                     properties_ |= Property.RequestSent;
+                    // debug
+                    if (logger.isLoggable(Level.FINE)) {
+                        int currentpos = buf.pos_;
+                        buf.pos_ = 0;
+                        logger.fine("Sent message in blocking at msgcount="
+                                + msgcount + ", size=" + buf.len_
+                                + ", the message piece is: \n" + buf.dumpData());
+                        buf.pos_ = currentpos;
+                        msgcount++;
+                    }
                 }
             }
         } else // Non blocking
         {
             synchronized (this) {
+            	int msgcount = 0;
                 while (true) {
                     if (!down.unsent())
                         break;
@@ -720,6 +738,19 @@ public final class GIOPConnectionThreade
                                 && dummy.operation().equals("_locate")) {
                             msgSentMarked = true;
                             properties_ |= Property.RequestSent;
+                            // debug
+                            if (logger.isLoggable(Level.FINE)) {
+                                int currentpos = buf.pos_;
+                                buf.pos_ = 0;
+                                logger.fine("Sent message in non-blocking at msgcount="
+                                        + msgcount
+                                        + ", size="
+                                        + buf.len_
+                                        + ", the message piece is: \n"
+                                        + buf.dumpData());
+                                buf.pos_ = currentpos;
+                                msgcount++;
+                            }
                         }
                     }
                 }

Modified: geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/ValueReader.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/ValueReader.java?rev=1359557&r1=1359556&r2=1359557&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/ValueReader.java (original)
+++ geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/ValueReader.java Tue
Jul 10 10:00:05 2012
@@ -366,7 +366,8 @@ final public class ValueReader {
     }
 
     private void readHeader(Header h) {
-        logger.fine("Reading header with tag value " + Integer.toHexString(h.tag)); 
+        logger.fine("Reading header with tag value " + Integer.toHexString(h.tag) + " at
pos=" 
+        		+ in_.buf_.pos_); 
         
         //
         // Special cases are handled elsewhere
@@ -965,8 +966,21 @@ final public class ValueReader {
         if (remoteCodeBase instanceof CodeBaseProxy) {
             remoteCodeBase = ((CodeBaseProxy) remoteCodeBase).getCodeBase();
         }
+        
+        java.io.Serializable serobj = null;
+        try {
+        	serobj = valueHandler.readValue(in_, h.headerPos, repoClass, repid, remoteCodeBase);
+        } catch (RuntimeException ex) {
+            logger.log(Level.FINE, "RuntimeException happens when reading GIOP stream coming
to pos_=" + in_.buf_.pos_);
+            logger.log(Level.FINE, "Wrong data section: \n" + in_.dumpData());
+            int currentpos = in_.buf_.pos_;
+            in_.buf_.pos_ = 0;
+            logger.log(Level.FINE, "Full GIOP stream dump: \n" + in_.dumpData());
+            in_.buf_.pos_ = currentpos;
+            throw ex;
+        }
 
-        return valueHandler.readValue(in_, h.headerPos, repoClass, repid, remoteCodeBase);
+        return serobj;
     }
     
     private Class resolveRepoClass(String name, String codebase) 



Mime
View raw message