1 Reply Latest reply: Apr 21, 2014 7:45 AM by Tim Blackman-Oracle RSS

    Getting java.io.NotSerializableException: oracle.kv.Durability

    da0b317f-2bde-46e3-b04c-d6caee262f1b

      Hi,

      I have created a KVStoreConfig object and set up its Consistency via setConsistency. I have not setup the Durability of this object but i am getting above exception. Full Stacktrace is :-

       

      java.io.NotSerializableException: oracle.kv.Durability

        at java.io.ObjectOutputStream.writeObject0(Unknown Source)

        at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)

        at java.io.ObjectOutputStream.writeSerialData(Unknown Source)

        at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)

        at java.io.ObjectOutputStream.writeObject0(Unknown Source)

        at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)

        at java.io.ObjectOutputStream.writeSerialData(Unknown Source)

        at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)

        at java.io.ObjectOutputStream.writeObject0(Unknown Source)

        at java.io.ObjectOutputStream.writeObject(Unknown Source)

        at java.util.HashMap.writeObject(Unknown Source)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)

        at java.io.ObjectOutputStream.writeSerialData(Unknown Source)

        at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)

        at java.io.ObjectOutputStream.writeObject0(Unknown Source)

        at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)

        at java.io.ObjectOutputStream.writeSerialData(Unknown Source)

        at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)

        at java.io.ObjectOutputStream.writeObject0(Unknown Source)

        at java.io.ObjectOutputStream.writeObject(Unknown Source)

        at java.util.Hashtable.writeObject(Unknown Source)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)

        at java.io.ObjectOutputStream.writeSerialData(Unknown Source)

        at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)

        at java.io.ObjectOutputStream.writeObject0(Unknown Source)

        at java.io.ObjectOutputStream.writeArray(Unknown Source)

        at java.io.ObjectOutputStream.writeObject0(Unknown Source)

        at java.io.ObjectOutputStream.access$300(Unknown Source)

        at java.io.ObjectOutputStream$PutFieldImpl.writeFields(Unknown Source)

        at java.io.ObjectOutputStream.writeFields(Unknown Source)

        at java.util.Vector.writeObject(Unknown Source)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)

        at java.io.ObjectOutputStream.writeSerialData(Unknown Source)

        at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)

        at java.io.ObjectOutputStream.writeObject0(Unknown Source)

        at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)

        at java.io.ObjectOutputStream.writeSerialData(Unknown Source)

        at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)

        at java.io.ObjectOutputStream.writeObject0(Unknown Source)

        at java.io.ObjectOutputStream.writeObject(Unknown Source)

        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)

        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

        at java.awt.Component.processMouseEvent(Unknown Source)

        at javax.swing.JComponent.processMouseEvent(Unknown Source)

        at java.awt.Component.processEvent(Unknown Source)

        at java.awt.Container.processEvent(Unknown Source)

        at java.awt.Component.dispatchEventImpl(Unknown Source)

        at java.awt.Container.dispatchEventImpl(Unknown Source)

        at java.awt.Component.dispatchEvent(Unknown Source)

        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

        at java.awt.Container.dispatchEventImpl(Unknown Source)

        at java.awt.Window.dispatchEventImpl(Unknown Source)

        at java.awt.Component.dispatchEvent(Unknown Source)

        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)

        at java.awt.EventQueue.access$200(Unknown Source)

        at java.awt.EventQueue$3.run(Unknown Source)

        at java.awt.EventQueue$3.run(Unknown Source)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)

        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)

        at java.awt.EventQueue$4.run(Unknown Source)

        at java.awt.EventQueue$4.run(Unknown Source)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)

        at java.awt.EventQueue.dispatchEvent(Unknown Source)

        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

        at java.awt.EventDispatchThread.run(Unknown Source)

       

       

      Please help !!!

        • 1. Re: Getting java.io.NotSerializableException: oracle.kv.Durability
          Tim Blackman-Oracle

          It looks like you've uncovered a bug.

           

          The Durability class should be serializable, because it is used as the value of a field of the serializable KVStoreConfig class, but it is not.

           

          I've submitted bug #23474 to our internal bug tracking system for this problem.

           

          As a workaround, you might be able to make use of the KVStoreConfig.toByteArray and fromByteArray methods to serialize and deserialize KVStoreConfig objects.  I see from your stack trace that you are storing a KVStoreConfig object in an GUI component.  Maybe you could serialize the configuration object and store the byte array instead?