Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1918

Serialization issue with Script component

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.5.4
    • 6.5.3
    • General
    • None

      During my initial tests with ZK 7 in our framework (that users serialization to save sessions) i stumbled over a issue while restoring serialized sessions.

      i've tracked down the issue a bit and created a small testcase to reproduce this issue. Just deploy the attached .zul and .java file to a ZK 7.0-Preview project and open the zul file. The 'session serialization' is faked in the controller class.

      In short: As soon as 'native' components like a <script>-tag occur in the zul file an exception is thrown during deserialization because it seems that 'native' components cannot be deserialized.

      Stacktrace:

      Caused by: org.zkoss.zk.ui.metainfo.DefinitionNotFoundException: Component definition not found: native
      at org.zkoss.zk.ui.metainfo.LanguageDefinition.getComponentDefinition(LanguageDefinition.java:464)
      at org.zkoss.zk.ui.metainfo.ComponentInfo.readObject(ComponentInfo.java:858)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      at java.util.LinkedList.readObject(LinkedList.java:1136)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:499)
      at org.zkoss.zk.ui.metainfo.ComponentInfo.readObject(ComponentInfo.java:853)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      at java.util.LinkedList.readObject(LinkedList.java:1136)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:499)
      at org.zkoss.zk.ui.metainfo.BranchInfo.readObject(BranchInfo.java:110)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      at org.zkoss.bug.Serialization1.doBeforeCompose(Serialization1.java:36)
      ... 29 more

        1. Serialization1.java
          2 kB
          christian
        2. serialization1.zul
          0.2 kB
          christian

            jumperchen jumperchen
            christian christian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: