You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Eelco Hillenius (JIRA)" <ji...@apache.org> on 2007/07/07 03:12:04 UTC

[jira] Resolved: (WICKET-727) WicketTester cause SerializableChecker$WicketNotSerializableException

     [ https://issues.apache.org/jira/browse/WICKET-727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eelco Hillenius resolved WICKET-727.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.0-beta3

> WicketTester cause SerializableChecker$WicketNotSerializableException
> ---------------------------------------------------------------------
>
>                 Key: WICKET-727
>                 URL: https://issues.apache.org/jira/browse/WICKET-727
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.0-beta2
>         Environment: linux 2.6 jdk6
>            Reporter: Ingram Chen
>             Fix For: 1.3.0-beta3
>
>
> When turn on logger level to info, testing with wicketTester see lots of SerializableChecker$WicketNotSerializableException stacktrace:
> ERROR - Objects                    - Error serializing object class org.apache.wicket.util.tester.DummyHomePage [object=[Page class = org.apache.wicket.util.tester.DummyHomePage, id = 0, version = 0]]
> org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: org.apache.wicket.util.tester.WicketTesterTest
> Field hierarchy is:
>   0 [class=org.apache.wicket.util.tester.DummyHomePage, path=0]
>     private org.apache.wicket.util.tester.ITestPageSource org.apache.wicket.util.tester.DummyHomePage.testPageSource [class=org.apache.wicket.util.tester.WicketTesterTest$1]
>       final org.apache.wicket.util.tester.WicketTesterTest org.apache.wicket.util.tester.WicketTesterTest$1.this$0 [class=org.apache.wicket.util.tester.WicketTesterTest] <----- field that is not serializable
> 	at org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:347)
> 	at org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
> The cause of error is annoymous inner class ITestPageSource:
> tester.startPage(new ITestPageSource()
> {
> 	private static final long serialVersionUID = 1L;
> 	public Page getTestPage()
> 	{
> 		Book mockBook = new Book("xxId", "xxName");
> 		return new ViewBook(mockBook);
> 	}
> });
> annonymous ITestPageSource instance reference to TestCase and TestCase is not serializable.
> To avoid serialize TestCase, we can make ITestPageSource field of DummyHomePage transient:
> public class DummyHomePage extends WebPage
> {
> 	private transient ITestPageSource testPageSource;
> ....
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.