Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6040

DebugBar not serializable exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.21.0
    • Fix Version/s: 6.22.0
    • Component/s: wicket-devutils
    • Labels:
      None
    • Environment:
      jdk 7, ubuntu

      Description

      After upgrading to 6.21.0 I encountered NotSerializableException when refreshing DebugBar in an ajax event. Martin Grigorov suspects this is related to https://github.com/apache/wicket/commit/562d43ccdd7f305f8ca641817f4b63a07ee8b6a6.

      To reproduce this:
      1. start the application in development mode
      2. override onEvent in Application to refresh the DebugBar
      public void onEvent(IEvent<?> event) {
      if(event.getPayload() instanceof AjaxRequestTarget) {
      AjaxRequestTarget target = (AjaxRequestTarget) event.getPayload();
      // if we are in development refresh the debugbar (if exists)
      if(getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT)

      { Component debugBar = page.get("debugBar"); if(debugBar != null) target.add(debugBar); }

      }

      From stacktrace it seems this is related to org.apache.wicket.ajax.AbstractAjaxResponse$AjaxHtmlHeaderContainer:

      Caused by: java.lang.RuntimeException: An error occurred while getting the model object for Component: [Component id = data, page = ro.emp.wicket.StandaloneHomePage, path = 2:debugBar:content:contributors:3:contrib:link:data.Label, isVisible = true, isVersioned = true, markup = [markup = jar:file:/home/fanfy/.m2/repository/org/apache/wicket/wicket-devutils/6.21.0/wicket-devutils-6.21.0.jar!/org/apache/wicket/devutils/debugbar/StandardDebugPanel.html
      <span wicket:id="data"></span>, index = 0, current = '<span wicket:id="data">' (line 0, column 0)]]
      at org.apache.wicket.Component.getDefaultModelObject(Component.java:1617) ~[wicket-core-6.21.0.jar:6.21.0]
      at org.apache.wicket.Component.getDefaultModelObjectAsString(Component.java:1640) ~[wicket-core-6.21.0.jar:6.21.0]
      at org.apache.wicket.markup.html.basic.Label.onComponentTagBody(Label.java:131) ~[wicket-core-6.21.0.jar:6.21.0]
      at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:71) ~[wicket-core-6.21.0.jar:6.21.0]
      at org.apache.wicket.Component.internalRenderComponent(Component.java:2536) ~[wicket-core-6.21.0.jar:6.21.0]
      ... 132 common frames omitted
      Caused by: org.apache.wicket.WicketRuntimeException: Internal error cloning object
      at org.apache.wicket.core.util.lang.WicketObjects.cloneObject(WicketObjects.java:361) ~[wicket-core-6.21.0.jar:6.21.0]
      at org.apache.wicket.core.util.lang.WicketObjects.sizeof(WicketObjects.java:425) ~[wicket-core-6.21.0.jar:6.21.0]
      at org.apache.wicket.devutils.debugbar.PageSizeDebugPanel$2.getObject(PageSizeDebugPanel.java:96) ~[wicket-devutils-6.21.0.jar:6.21.0]
      at org.apache.wicket.devutils.debugbar.PageSizeDebugPanel$2.getObject(PageSizeDebugPanel.java:89) ~[wicket-devutils-6.21.0.jar:6.21.0]
      at org.apache.wicket.Component.getDefaultModelObject(Component.java:1612) ~[wicket-core-6.21.0.jar:6.21.0]
      ... 136 common frames omitted
      Caused by: java.io.NotSerializableException: org.apache.wicket.ajax.AjaxRequestHandler$1

      • field (class "org.apache.wicket.ajax.AbstractAjaxResponse$AjaxHtmlHeaderContainer", name: "this$0", type: "class org.apache.wicket.ajax.AbstractAjaxResponse")
      • object (class "org.apache.wicket.ajax.AbstractAjaxResponse$AjaxHtmlHeaderContainer", [AjaxHtmlHeaderContainer [Component id = _header_]])
      • element of array (index: 9)
      • array (class "[Ljava.lang.Object;", size: 18)
      • field (class "org.apache.wicket.MarkupContainer$ChildList", name: "childs", type: "class [Ljava.lang.Object;")
      • object (class "org.apache.wicket.MarkupContainer$ChildList", [[Component id = applicationTitle], [FocusComponentFeedbackPanel [Component id = feedbackPanel]], [DebugBar [Component id = debugBar]], [StackComponentContainerImpl [Component id = contentContainer]], [GlobalMenuPanel [Component id = menu]], [Fragment [Component id = customHeader]], [Fragment [Component id = customFooter]], [WebMarkupContainer [Component id = localeContainer]], [WebMarkupContainer [Component id = userInformations]], [AjaxHtmlHeaderContainer [Component id = _header_]]])
      • field (class "org.apache.wicket.MarkupContainer", name: "children", type: "class java.lang.Object")
      • root object (class "ro.emp.wicket.StandaloneHomePage", [Page class = ro.emp.wicket.StandaloneHomePage, id = 2, render count = 3])
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1377) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1173) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) ~[na:1.7.0_80]
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) ~[na:1.7.0_80]
        at org.apache.wicket.core.util.lang.WicketObjects.cloneObject(WicketObjects.java:306) ~[wicket-core-6.21.0.jar:6.21.0]
        ... 140 common frames omitted

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                svenmeier Sven Meier
                Reporter:
                elvis.ciocoiu Elvis Ciocoiu
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: