in the new wicket object outputstream i can generated exactly the path for
you
and exactly what field goes wrong.

Ofcourse what i also can do is just completely disable the serializeable
test and just do it ;)

johan


On 2/12/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:

Folks,

In 1.3 we worked hard this week to improve the diagnostics of
Serialization errors. I know from experience that when tracking down
non-serializable classes/ fields, the JDK's default serialization
isn't very helpful. Especially when you work a lot with inner classes
etc.

https://issues.apache.org/jira/browse/WICKET-265 is the issue we use
for tracking our improvements. I think we've got it pinned down pretty
well now. You'll get stacktraces like:

wicket.util.io.SerializableChecker$WicketNotSerializableException:
Unable to serialize class: ts4.component.cwt.CwtComponent
Field hierarchy is:
  1 [class=ts4.web.wicket.page.workspace.ComponentPage, path=1]
    private java.lang.Object wicket.MarkupContainer.children
[class=[Lwicket.Component;]
      private java.lang.Object wicket.MarkupContainer.children[1]
[class=ts4.web.wicket.page.workspace.TopBarPanel, path=1:top-bar]
        private java.lang.Object wicket.MarkupContainer.children
[class=[Lwicket.Component;]
          private java.lang.Object wicket.MarkupContainer.children[0]
[class=wicket.markup.html.WebMarkupContainer, path=1:top-bar:holder]
            private java.lang.Object wicket.MarkupContainer.children
[class=ts4.web.wicket.page.workspace.ComponentBreadCrumbs,
path=1:top-bar:holder:crumbs]
              private final ts4.component.WorkspaceComponent
ts4.web.wicket.page.workspace.ComponentBreadCrumbs.component
[class=ts4.component.cwt.CwtComponent] <----- field that is not
serializable
        at wicket.util.io.SerializableChecker.check(
SerializableChecker.java:334)
        at wicket.util.io.SerializableChecker.checkFields(
SerializableChecker.java:616)
        at wicket.util.io.SerializableChecker.check(
SerializableChecker.java:530)
        at wicket.util.io.SerializableChecker.checkFields(
SerializableChecker.java:616)
        at wicket.util.io.SerializableChecker.check(
SerializableChecker.java:530)
        at wicket.util.io.SerializableChecker.check(
SerializableChecker.java:368)
        at wicket.util.io.SerializableChecker.checkFields(
SerializableChecker.java:616)
        at wicket.util.io.SerializableChecker.check(
SerializableChecker.java:530)
        at wicket.util.io.SerializableChecker.check(
SerializableChecker.java:368)
        at wicket.util.io.SerializableChecker.checkFields(
SerializableChecker.java:616)
        at wicket.util.io.SerializableChecker.check(
SerializableChecker.java:530)
        at wicket.util.io.SerializableChecker.writeObjectOverride(
SerializableChecker.java:684)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java
:287)
        at wicket.util.lang.Objects.objectToByteArray(Objects.java:1056)
        at wicket.protocol.http.FilePageStore.serializePage(
FilePageStore.java:414)
        at wicket.protocol.http.FilePageStore.access$4(FilePageStore.java
:407)
        at wicket.protocol.http.FilePageStore$PageSavingThread.run(
FilePageStore.java:601)
        at java.lang.Thread.run(Thread.java:613)
Caused by: java.io.NotSerializableException:
ts4.component.cwt.CwtComponent
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java
:1075)
        at java.io.ObjectOutputStream.defaultWriteFields(
ObjectOutputStream.java:1369)
        at java.io.ObjectOutputStream.writeSerialData(
ObjectOutputStream.java:1341)
...


I hope this will be a useful improvement for all of you working on
1.3. If you have improvements/ patches, they are as always welcome.
You can find the whole deal in wicket.util.io.SerializableChecker. I
hope to do a port to 2.0 later this week.

Eelco

Reply via email to