Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Not A Problem
-
1.5.10
-
None
-
None
Description
Serializing a Page that contains both a @SpringBean annotated bean and a DebugBar breaks in 1.5.10. The same thing works in 1.5.9.
It is related to how WicketObjects.sizeof() has changed between 1.5.9 and 1.5.10. Related issues:
I have prepared a quickstart.
Stacktrace for 1.5.10:
```
org.apache.wicket.WicketRuntimeException: Exception in rendering component: [Component id = data]
at org.apache.wicket.Component.internalRenderComponent(Component.java:2590)
at org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:56)
at org.apache.wicket.Component.internalRender(Component.java:2393)
at org.apache.wicket.Component.render(Component.java:2321)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1428)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1592)
at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1567)
at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1521)
at org.apache.wicket.markup.html.link.AbstractLink.onComponentTagBody(AbstractLink.java:184)
at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:72)
at org.apache.wicket.Component.internalRenderComponent(Component.java:2563)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1530)
at org.apache.wicket.Component.internalRender(Component.java:2393)
at org.apache.wicket.Component.render(Component.java:2321)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1428)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1592)
at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1567)
at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:689)
at org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderAssociatedMarkup(AssociatedMarkupSourcingStrategy.java:76)
at org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.onComponentTagBody(PanelMarkupSourcingStrategy.java:112)
at org.apache.wicket.Component.internalRenderComponent(Component.java:2563)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1530)
at org.apache.wicket.Component.internalRender(Component.java:2393)
at org.apache.wicket.Component.render(Component.java:2321)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1428)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1592)
at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1567)
at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1521)
at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:72)
at org.apache.wicket.Component.internalRenderComponent(Component.java:2563)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1530)
at org.apache.wicket.Component.internalRender(Component.java:2393)
at org.apache.wicket.Component.render(Component.java:2321)
at org.apache.wicket.markup.html.list.ListView.renderItem(ListView.java:585)
at org.apache.wicket.markup.html.list.ListView.renderChild(ListView.java:574)
at org.apache.wicket.markup.repeater.AbstractRepeater.onRender(AbstractRepeater.java:97)
at org.apache.wicket.Component.internalRender(Component.java:2393)
at org.apache.wicket.Component.render(Component.java:2321)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1428)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1592)
at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1567)
at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1521)
at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:72)
at org.apache.wicket.Component.internalRenderComponent(Component.java:2563)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1530)
at org.apache.wicket.Component.internalRender(Component.java:2393)
at org.apache.wicket.Component.render(Component.java:2321)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1428)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1592)
at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1567)
at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:689)
at org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderAssociatedMarkup(AssociatedMarkupSourcingStrategy.java:76)
at org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.onComponentTagBody(PanelMarkupSourcingStrategy.java:112)
at org.apache.wicket.Component.internalRenderComponent(Component.java:2563)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1530)
at org.apache.wicket.Component.internalRender(Component.java:2393)
at org.apache.wicket.Component.render(Component.java:2321)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1428)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1592)
at org.apache.wicket.Page.onRender(Page.java:907)
at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:140)
at org.apache.wicket.Component.internalRender(Component.java:2393)
at org.apache.wicket.Component.render(Component.java:2321)
at org.apache.wicket.Page.renderPage(Page.java:1035)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:118)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:246)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:696)
at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:624)
at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:860)
at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:876)
at com.mycompany.HomePageTest.foo(HomePageTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.RuntimeException: An error occurred while getting the model object for Component: [Component id = data, page = com.mycompany.HomePage, path = 0:debugBar:content:contributors:3:contrib:link:data.Label, isVisible = true, isVersioned = true, markup = [markup = jar:file:something.m2/repository/org/apache/wicket/wicket-devutils/1.5.10/wicket-devutils-1.5.10.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:1679)
at org.apache.wicket.Component.getDefaultModelObjectAsString(Component.java:1701)
at org.apache.wicket.markup.html.basic.Label.onComponentTagBody(Label.java:113)
at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:72)
at org.apache.wicket.Component.internalRenderComponent(Component.java:2563)
... 99 more
Caused by: org.apache.wicket.WicketRuntimeException: Internal error cloning object
at org.apache.wicket.util.lang.WicketObjects.cloneObject(WicketObjects.java:361)
at org.apache.wicket.util.lang.WicketObjects.sizeof(WicketObjects.java:425)
at org.apache.wicket.devutils.debugbar.PageSizeDebugPanel$2.getObject(PageSizeDebugPanel.java:95)
at org.apache.wicket.devutils.debugbar.PageSizeDebugPanel$2.getObject(PageSizeDebugPanel.java:92)
at org.apache.wicket.Component.getDefaultModelObject(Component.java:1674)
... 103 more
Caused by: java.io.NotSerializableException: com.mycompany.spring.impl.MyBeanImpl
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.apache.wicket.util.lang.WicketObjects.cloneObject(WicketObjects.java:306)
... 107 more
```