David E Jones wrote: > > Interesting... this is worrisome as it means something isn't using the > ByteWrapper properly. Only the bytes in the ByteWrapper should be sent > to the database, not a serialized version of the object itself. > > Because this issue exists we have a problem though... updating the > ByteWrapper object will make existing database data stored with it > useless unless the ByteWrapper object NEVER changes. > > Tim, do you have a full stack trace on that? I'd like to trace through > the code in the content stuff as well as the database that does both the > saves and loads. > > As an interim fix, change the ByteWrapper.java file back to its original > version (before the enhancements that Adam did recently). I don't know > if we want to do this in the trunk, but I'll look at that as part of the > above mentioned review.
Oh bother. I added 2 new write methods. Since ByteWrapper implements Serializable, and does *not* set it's own serialVersionID, one is auto-generated based on the defined method signatures, and a hash. This can be fixed, but requires implementing the hidden private methods. That'll fix it going forward. Since there is no set serialVersionID, each compiler is free to implement it's own algorithm for setting it; it's really poor to not have one. I'm not sure this can be fixed in a backwards compatible manner. (this goes for other serializable classes too) > > -David > > > On Oct 22, 2007, at 3:35 PM, Tim Ruppert wrote: > >> This was working last week before the supreme amount of changes. >> Anybody got any ideas why this would be the case now: >> >> org.ofbiz.webapp.view.ViewHandlerException: Error in >> streamDataResource (Unable to read BLOB data from input stream while >> getting value : imageData [IMAGE_DATA] (1): >> java.io.InvalidClassException: org.ofbiz.entity.util.ByteWrapper; >> local class incompatible: stream classdesc serialVersionUID = >> -2019470610749810950, local class serialVersionUID = >> -7811889960144925895 (org.ofbiz.entity.util.ByteWrapper; local class >> incompatible: stream classdesc serialVersionUID = >> -2019470610749810950, local class serialVersionUID = >> -7811889960144925895)) >> >> This is on a fresh checkout, so there are no old classes, etc. >> >> Cheers, >> Tim >> -- >> Tim Ruppert >> HotWax Media >> http://www.hotwaxmedia.com >> >> o:801.649.6594 >> f:801.649.6595 >> >> >
