You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thomas Heigl <th...@umschalt.com> on 2018/06/07 14:25:56 UTC

ChainingModel warnings in Wicket 8

Hi all,

After porting our app to Wicket 8, I'm getting these warnings on my test
environment:

WAR o.a.w.model.ChainingModel It is not a good idea to reference a
> non-serializable instance in models directly as it may lead to
> serialization problems


The warning is OK, but it gives me absolutely no hint where to look for the
issue. Could someone please add the (simple) class name of the model object
to the warning message?

Currently, the only way for me to find these issues is with a breakpoint in
`ChainingModel` and clicking through my application until I hit the warning.

Best,

Thomas

Re: ChainingModel warnings in Wicket 8

Posted by Thomas Heigl <th...@umschalt.com>.
Hi Maxim,

Created https://issues.apache.org/jira/browse/WICKET-6560.

Thomas

On Sat, Jun 9, 2018 at 5:44 AM, Maxim Solodovnik <so...@gmail.com>
wrote:

> Sounds like these 2 comments worth JIRA
> Or Jira+PR ;))
>
> On Thu, Jun 7, 2018 at 9:45 PM, Thomas Heigl <th...@umschalt.com> wrote:
> > Also the warning is logged for `null` objects, which probably shouldn't
> > happen.
> >
> > public ChainingModel(final Object modelObject)
> >> {
> >>     if (modelObject instanceof Session)
> >>     {
> >>         LOG.warn("It is not a good idea to reference the .........");
> >>     } else if (modelObject instanceof Serializable == false)
> >>     {
> >>         LOG.warn("It is not a good idea to reference a non-serializable
> >> instance ....");
> >>     }
> >>     target = modelObject;
> >> }
> >
> >
> > It should read something like:
> >
> > if (modelObject != null && modelObject instanceof Serializable == false)
> >
> >
> > Best,
> >
> > Thomas
> >
> >
> > On Thu, Jun 7, 2018 at 4:25 PM, Thomas Heigl <th...@umschalt.com>
> wrote:
> >
> >> Hi all,
> >>
> >> After porting our app to Wicket 8, I'm getting these warnings on my test
> >> environment:
> >>
> >> WAR o.a.w.model.ChainingModel It is not a good idea to reference a
> >>> non-serializable instance in models directly as it may lead to
> >>> serialization problems
> >>
> >>
> >> The warning is OK, but it gives me absolutely no hint where to look for
> >> the issue. Could someone please add the (simple) class name of the model
> >> object to the warning message?
> >>
> >> Currently, the only way for me to find these issues is with a breakpoint
> >> in `ChainingModel` and clicking through my application until I hit the
> >> warning.
> >>
> >> Best,
> >>
> >> Thomas
> >>
>
>
>
> --
> WBR
> Maxim aka solomax
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: ChainingModel warnings in Wicket 8

Posted by Maxim Solodovnik <so...@gmail.com>.
Sounds like these 2 comments worth JIRA
Or Jira+PR ;))

On Thu, Jun 7, 2018 at 9:45 PM, Thomas Heigl <th...@umschalt.com> wrote:
> Also the warning is logged for `null` objects, which probably shouldn't
> happen.
>
> public ChainingModel(final Object modelObject)
>> {
>>     if (modelObject instanceof Session)
>>     {
>>         LOG.warn("It is not a good idea to reference the .........");
>>     } else if (modelObject instanceof Serializable == false)
>>     {
>>         LOG.warn("It is not a good idea to reference a non-serializable
>> instance ....");
>>     }
>>     target = modelObject;
>> }
>
>
> It should read something like:
>
> if (modelObject != null && modelObject instanceof Serializable == false)
>
>
> Best,
>
> Thomas
>
>
> On Thu, Jun 7, 2018 at 4:25 PM, Thomas Heigl <th...@umschalt.com> wrote:
>
>> Hi all,
>>
>> After porting our app to Wicket 8, I'm getting these warnings on my test
>> environment:
>>
>> WAR o.a.w.model.ChainingModel It is not a good idea to reference a
>>> non-serializable instance in models directly as it may lead to
>>> serialization problems
>>
>>
>> The warning is OK, but it gives me absolutely no hint where to look for
>> the issue. Could someone please add the (simple) class name of the model
>> object to the warning message?
>>
>> Currently, the only way for me to find these issues is with a breakpoint
>> in `ChainingModel` and clicking through my application until I hit the
>> warning.
>>
>> Best,
>>
>> Thomas
>>



-- 
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: ChainingModel warnings in Wicket 8

Posted by Thomas Heigl <th...@umschalt.com>.
Also the warning is logged for `null` objects, which probably shouldn't
happen.

public ChainingModel(final Object modelObject)
> {
>     if (modelObject instanceof Session)
>     {
>         LOG.warn("It is not a good idea to reference the .........");
>     } else if (modelObject instanceof Serializable == false)
>     {
>         LOG.warn("It is not a good idea to reference a non-serializable
> instance ....");
>     }
>     target = modelObject;
> }


It should read something like:

if (modelObject != null && modelObject instanceof Serializable == false)


Best,

Thomas


On Thu, Jun 7, 2018 at 4:25 PM, Thomas Heigl <th...@umschalt.com> wrote:

> Hi all,
>
> After porting our app to Wicket 8, I'm getting these warnings on my test
> environment:
>
> WAR o.a.w.model.ChainingModel It is not a good idea to reference a
>> non-serializable instance in models directly as it may lead to
>> serialization problems
>
>
> The warning is OK, but it gives me absolutely no hint where to look for
> the issue. Could someone please add the (simple) class name of the model
> object to the warning message?
>
> Currently, the only way for me to find these issues is with a breakpoint
> in `ChainingModel` and clicking through my application until I hit the
> warning.
>
> Best,
>
> Thomas
>