Uploaded image for project: 'JBoss Marshalling'
  1. JBoss Marshalling
  2. JBMAR-77

Marshalling a java.util.Date in Serializable throws: DateNotActiveException: Fields were never written

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.2.0.CR4
    • 1.2.0.CR3
    • River
    • None

      Marshalling the following class:

      static class TestSerializable000 implements Serializable {
      public String contentType;
      public byte[] data;
      public Date lastModified = new Date();

      public TestSerializable000() {}

      public TestSerializable000(String contentType, byte[] data)

      { this.contentType = contentType; this.data = data; }

      }

      Fails with:

      java.io.NotActiveException: Fields were never written
      at org.jboss.marshalling.river.RiverObjectOutputStream.finish(RiverObjectOutputStream.java:174)
      at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1075)
      at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:955)
      at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1129)
      at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1085)
      at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:955)
      at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:407)
      at org.jboss.test.marshalling.SimpleMarshallerTests$51.runWrite(SimpleMarshallerTests.java:1705)
      at org.jboss.test.marshalling.TestBase.runReadWriteTest(TestBase.java:109)
      at org.jboss.test.marshalling.SimpleMarshallerTests.testSerializable000(SimpleMarshallerTests.java:1703)
      Caused by: an exception which occurred:
      in field lastModified
      in object org.jboss.test.marshalling.SimpleMarshallerTests$TestSerializable000@b041b0
      ... Removed 22 stack frames

            johnbailey_jira John Bailey (Inactive)
            rh-ee-galder Galder ZamarreƱo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: