Anonymous | Login | Signup for a new account | 12-17-2024 14:49 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Advanced Details [ Jump to Notes ] | [ View Simple ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0003663 | [Hessian] | minor | always | 09-01-09 20:00 | 12-16-09 15:10 | ||||
Reporter | danwatt | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | Platform | |||||
Status | closed | OS | |||||||
Projection | none | OS Version | |||||||
ETA | none | Fixed in Version | 4.0.3 | Product Version | 4.0.1 | ||||
Product Build | |||||||||
Summary | 0003663: Can't deserialize an object with an EnumSet | ||||||||
Description |
When serializing an object that has an EnumSet inside of it, or for that matter directly serializing an EnumSet, the serialization happens just fine. However, when deserializing, an InvocationTargetException is thrown. Code demonstrating this issues is in the additional information. |
||||||||
Steps To Reproduce | |||||||||
Additional Information |
import java.io.ByteArrayInputStream; import java.util.EnumSet; import org.apache.commons.io.output.ByteArrayOutputStream; import com.caucho.hessian.io.Hessian2StreamingInput; import com.caucho.hessian.io.Hessian2StreamingOutput; public class HessianFail { public static enum Test{A,B}; public static void main(String[] args) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); Hessian2StreamingOutput out = new Hessian2StreamingOutput(baos); out.writeObject(EnumSet.noneOf(Test.class)); out.close(); Hessian2StreamingInput in = new Hessian2StreamingInput(new ByteArrayInputStream(baos.toByteArray())); EnumSet<Test> e = (EnumSet<Test>) in.readObject(); } } Stacktrace: Exception in thread "main" com.caucho.hessian.io.HessianProtocolException: 'java.util.EnumSet$SerializationProxy' could not be instantiated at com.caucho.hessian.io.JavaDeserializer.instantiate(JavaDeserializer.java:282) at com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:162) at com.caucho.hessian.io.SerializerFactory.readObject(SerializerFactory.java:501) at com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2098) at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2030) at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2014) at com.caucho.hessian.io.Hessian2Input.readStreamingObject(Hessian2Input.java:2267) at com.caucho.hessian.io.Hessian2StreamingInput.readObject(Hessian2StreamingInput.java:102) at HessianFail.main(HessianFail.java:22) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at com.caucho.hessian.io.JavaDeserializer.instantiate(JavaDeserializer.java:278) ... 8 more Caused by: java.lang.NullPointerException at java.util.EnumSet$SerializationProxy.<init>(EnumSet.java:392) ... 13 more |
||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
33 total queries executed. 28 unique queries executed. |