BTW. a bug in this direction was filed against the SUN JDK. the "mapping table" should be exposed, to avoid copy/past development w/in custom ObjectInputStream impls
http://bugs.sun.com/view_bug.do?bug_id=4942688 -M On Wed, Aug 11, 2010 at 4:46 PM, Jimmy,Jing Lv <firep...@gmail.com> wrote: > Thanks Matthias, a lesson to me ;) > > 2010/8/11 Matthias Wessendorf <mat...@apache.org> > >> a little background. >> >> I am working on an Apache MyFaces project, were we have our own >> ObjectInputStream class ([1]). >> Now when we update to the latest version of one of our dependencies >> (JSF 2.0, Sun Mojarra), we >> got this exception: >> java.lang.ClassNotFoundException: void >> ... >> >> I filed a bug against them, b/c of that (see [2] for more). They said >> the reason why we see it is that with the new version one of their >> helper class stores null values as >> Void.TYPE(s). Therefore they suggested to do what the JDK does. >> >> The did a very simple patch ([3]), which I think is code from the Sun >> JDK 1.6.x of the "standard" ObjectInputStream. >> In order to avoid any license issues, by looking into Sun's JDK, I >> opened Harmony can "borrowed" code. >> >> So I am wondering if the void has been forgotten..., since I suspect >> (as of [3]) that the Sun JDK's ObjectInputStream does >> register void/void.class.... >> >> BTW. I changed our custom ObjectInputStream patch (see [4]) and the >> error (java.lang.ClassNotFoundException: void) is now gone >> >> Greetings, >> Matthias >> >> [1] >> https://issues.apache.org/jira/secure/attachment/12439193/1.2.12.2_compressviewstate.patch >> [2] https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1607 >> [3] >> https://javaserverfaces.dev.java.net/nonav/issues/showattachment.cgi/1241/1607.txt >> [4] >> https://issues.apache.org/jira/secure/attachment/12451648/TRINIDAD-1747_August10.patch >> >> >> On Wed, Aug 11, 2010 at 10:21 AM, Jimmy,Jing Lv <firep...@gmail.com> >> wrote: >> > Hi Matthias, >> > >> > I suppose ObjectInputStream is mainly use to serialize Object but >> void >> > is not a kind of Class to be serialized. Please tell me if I am wrong. >> > >> > 2010/8/10 Mark Hindess <mark.hind...@googlemail.com> >> > >> >> >> >> In message <AANLkTinN_KKS+RkLZfXup2tGHBAoR-9FVB8om3MCi9u=@ >> mail.gmail.com>, >> >> Matthias Wessendorf writes: >> >> > >> >> > Hello, >> >> > >> >> > looking at ObjectInputStream.java, >> >> > >> >> > static { >> >> > PRIMITIVE_CLASSES.put("byte", byte.class); //$NON-NLS-1$ >> >> > PRIMITIVE_CLASSES.put("short", short.class); //$NON-NLS-1$ >> >> > PRIMITIVE_CLASSES.put("int", int.class); //$NON-NLS-1$ >> >> > PRIMITIVE_CLASSES.put("long", long.class); //$NON-NLS-1$ >> >> > PRIMITIVE_CLASSES.put("boolean", boolean.class); //$NON-NLS-1$ >> >> > PRIMITIVE_CLASSES.put("char", char.class); //$NON-NLS-1$ >> >> > PRIMITIVE_CLASSES.put("float", float.class); //$NON-NLS-1$ >> >> > PRIMITIVE_CLASSES.put("double", double.class); //$NON-NLS-1$ >> >> > } >> >> > >> >> > I am wondering why there is no "void", void.class key-value pair? >> >> >> >> I see you've raised a JIRA bug for this. I'm struggling to understand >> >> in what context this would be needed. Can you provide a test case that >> >> shows why it is needed? >> >> >> >> Regards, >> >> Mark. >> >> >> >> >> >> >> > >> > >> > -- >> > >> > Best Regards! >> > >> > Jimmy, Jing Lv >> > >> >> >> >> -- >> Matthias Wessendorf >> >> blog: http://matthiaswessendorf.wordpress.com/ >> sessions: http://www.slideshare.net/mwessendorf >> twitter: http://twitter.com/mwessendorf >> > > > > -- > > Best Regards! > > Jimmy, Jing Lv > China Software Development Lab, IBM > -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf