Mantis - Hessian
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
3663 | minor | always | 09-01-09 20:00 | 12-16-09 15:10 | |
|
|||||
Reporter: | danwatt | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 4.0.1 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 4.0.3 | ||
|
|||||
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 |
||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|