-
Patch
-
Resolution: Obsolete
-
Minor
-
None
-
None
Unfortunately I am not able to provide a test case or to formulate exact conditions of how to reproduce the bug.
The bug happened when client and server were on dirreferent machines, on server we turned on PooledInvoker and on client we have our own classloader (somewhat similar to old JBoss 2.* classloader). Some client requests run normally, but some caused StreamCorruptedException on client. The bug disappeared once I modified PooledInvoker.java and PooledInvokerProxy.java in the following way: in the code where input and output streams for socket are initialized I replaced OptimizedObjectOutputStream with ObjectOutputStream and OptimizedObjectInputStream with ObjectInputStream, also I removed BufferedOutputStream and BufferedInputStream at all. Now everything works.
Also I suppose that using "Optimized" streams and additional buffered streams yields an unnecesary overhead. Doesn't socket implementation have internal buffers? I think this is a part of TCP/IP. Isn't standard class lookup in Java optimized enough so that additional HashMap with WeakReferences to classes is necessary? The class comment says that "Optimized" streams ensure the classes and proxies are loaded using the thread context class loader, but JRMPInvoker works fine without additional care about thread context class loader.