harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject [classlib][luni] Harmony fails to deserialize org.jfree.data.category.DefaultCategoryDataset
Date Thu, 17 May 2007 11:14:13 GMT
Hi,

When I run an existing application, I found that Harmony fails to
deserialize DefaultCategoryDataset. Here is a simple test case to reproduce
the problem. Any ideas? Thanks!

   public void testSerializable() throws Exception {
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        getSerialiableObject(dataset);
    }

    public static Object getSerialiableObject(Object obj) throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(obj);
        oos.close();
        ByteArrayInputStream bais = new ByteArrayInputStream(
baos.toByteArray());
        ObjectInputStream fis = new ObjectInputStream(bais);
        return fis.readObject();
    }

It throws the following exception:

java.io.NotActiveException
    at java.io.ObjectInputStream.registerValidation(Unknown Source)
    at org.jfree.data.general.AbstractDataset.readObject(
AbstractDataset.java:220)
    at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
    at java.lang.reflect.Method.invoke(Method.java:381)
    at java.io.ObjectInputStream.readObjectForClass(Unknown Source)
    at java.io.ObjectInputStream.readHierarchy(Unknown Source)
    at java.io.ObjectInputStream.readNewObject(Unknown Source)
    at java.io.ObjectInputStream.readNonPrimitiveContent(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at
serialization.DefaultCategoryDatasetSerializationTest.getSerialiableObject(
DefaultCategoryDatasetSerializationTest.java:24)
    at
serialization.DefaultCategoryDatasetSerializationTest.testSerializable(
DefaultCategoryDatasetSerializationTest.java:14)
    at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
    at java.lang.reflect.Method.invoke(Method.java:381)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(
JUnit3TestReference.java:128)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
RemoteTestRunner.java:196)


-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message