Forrest, We need to switch the order of the if check otherwise we might be seeing NPE instead of the marshal exception.
Jarek On Thu, Jul 12, 2012 at 3:41 AM, <[email protected]> wrote: > Author: xiaming > Date: Thu Jul 12 07:41:15 2012 > New Revision: 1360561 > > URL: http://svn.apache.org/viewvc?rev=1360561&view=rev > Log: > GERONIMOTCK-133 Add logic to allow YOKO endure invalid value type tag sent > from RI, a new system property org.apache.yoko.ignoreInvalidValueTag > introduced > > Modified: > > 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/ValueReader.java > URL: > http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-core/src/main/java/org/apache/yoko/orb/OB/ValueReader.java?rev=1360561&r1=1360560&r2=1360561&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 > Thu Jul 12 07:41:15 2012 > @@ -1076,7 +1076,18 @@ final public class ValueReader { > } > ClassCreationStrategy strategy = new ClassCreationStrategy(this, in_, > clz); > - return read(strategy); > + java.io.Serializable result = null; > + try { > + result = read(strategy); > + } catch (org.omg.CORBA.MARSHAL marshalex) { > + logger.severe(marshalex.getMessage() + " at pos=" + > (in_.buf_.pos_- 4)); > + if > (System.getProperty("org.apache.yoko.ignoreInvalidValueTag").equalsIgnoreCase("true")) > { > + result = read(strategy); > + } else { > + throw marshalex; > + } > + } > + return result; > } > > public java.io.Serializable readValueBox( > >
