You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by smallufo <sm...@gmail.com> on 2020/05/30 13:46:52 UTC

Locatable UnsupportedOperationException

Hi
I am building an app with complicated forms , nested models ...
Some times it obsesses me is the UnsupportedOperationException :

java.lang.UnsupportedOperationException: Override this method to support
setObject(Object)

at org.apache.wicket.model.IModel.setObject(IModel.java:84)
It doesn't pinpoint me which model , which form , which panel...
very hard to debug...
For non-serializable exception , it can provide meaning information , even
pinpoint which field causes the problem.
I hope some day , this UnsupportedOperationException can also be so
informative.

Thanks.

Re: Locatable UnsupportedOperationException

Posted by Martin Grigorov <mg...@apache.org>.
https://issues.apache.org/jira/browse/WICKET-6796

On Mon, Jun 1, 2020 at 4:08 PM Sven Meier <sv...@meiers.net> wrote:

> +1 that should have no negative impact
>
> Sven
>
> On 01.06.20 11:22, Martin Grigorov wrote:
> > Hi,
> >
> > I like the idea to catch UnsupportedOperationException at
> > org.apache.wicket.IGenericComponent#setModelObject(T) and re-throw it as:
> > throw new WicketRuntimeException("You need to use read/write Model for
> > component '{}", this.getPageRelativePath(), uox)
> >
> > Does anyone see a drawback ?
> >
> > Martin
> >
> > On Sat, May 30, 2020 at 11:42 PM Sven Meier <sv...@meiers.net> wrote:
> >
> >> Hi,
> >>
> >> just put a breakpoint on IModel#setObject().
> >>
> >> Once your problem hits that breakpoint, you'll be able to derive the
> >> offending component/model from the stacktrace/variables in your favorite
> >> IDE.
> >>
> >> Have fun
> >> Sven
> >>
> >>
> >> On 30.05.20 17:13, smallufo wrote:
> >>> Is it possible to try { setObjectObject(value) } catch { e }
> >>> and pinpoint which class/model causes this problem ?
> >>> Or is it too costly ?
> >>>
> >>>
> >>> Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六
> 下午11:02寫道:
> >>>
> >>>> Hope that help
> >>>>
> >>>> During the process of throwing an exception, the Java Virtual Machine
> >>>> abruptly completes, one by one, any expressions, statements, method
> and
> >>>> constructor invocations, initializers, and field initialization
> >> expressions
> >>>> that have begun but not completed execution in the current thread.
> This
> >>>> process continues until a handler is found that indicates that it
> >> handles
> >>>> that particular exception by naming the class of the exception or a
> >>>> superclass of the class of the exception (§11.2 <
> >>>>
> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.2
> >>> ).
> >>>> If no such handler is found, then the exception may be handled by one
> >> of a
> >>>> hierarchy of uncaught exception handlers (§11.3 <
> >>>>
> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.3
> >>> )
> >>>> - thus every effort is made to avoid letting an exception go
> unhandled.
> >>>>
> >>>> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html <
> >>>> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html>
> >>>>
> >>>>
> >>>> François
> >>>>
> >>>>
> >>>>
> >>>>> Le 30 mai 2020 à 16:52, smallufo <sm...@gmail.com> a écrit :
> >>>>>
> >>>>> Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六
> >> 下午10:48寫道:
> >>>>>> sompage?67-1.-border-content-border_body-form is the path to your
> >> model
> >>>>> Yes , but it may contains deep-nested model
> >>>>>
> >>>>> The form contains FormComponentPanel and contains another
> >>>>> FormComponentPanels and widgets , very deep ...
> >>>>> The error may lay under very deep model , which is very hard to
> debug.
> >>>>> And the error message should be able to pinpoint which model causes
> the
> >>>>> problem
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Locatable UnsupportedOperationException

Posted by Sven Meier <sv...@meiers.net>.
+1 that should have no negative impact

Sven

On 01.06.20 11:22, Martin Grigorov wrote:
> Hi,
>
> I like the idea to catch UnsupportedOperationException at
> org.apache.wicket.IGenericComponent#setModelObject(T) and re-throw it as:
> throw new WicketRuntimeException("You need to use read/write Model for
> component '{}", this.getPageRelativePath(), uox)
>
> Does anyone see a drawback ?
>
> Martin
>
> On Sat, May 30, 2020 at 11:42 PM Sven Meier <sv...@meiers.net> wrote:
>
>> Hi,
>>
>> just put a breakpoint on IModel#setObject().
>>
>> Once your problem hits that breakpoint, you'll be able to derive the
>> offending component/model from the stacktrace/variables in your favorite
>> IDE.
>>
>> Have fun
>> Sven
>>
>>
>> On 30.05.20 17:13, smallufo wrote:
>>> Is it possible to try { setObjectObject(value) } catch { e }
>>> and pinpoint which class/model causes this problem ?
>>> Or is it too costly ?
>>>
>>>
>>> Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六 下午11:02寫道:
>>>
>>>> Hope that help
>>>>
>>>> During the process of throwing an exception, the Java Virtual Machine
>>>> abruptly completes, one by one, any expressions, statements, method and
>>>> constructor invocations, initializers, and field initialization
>> expressions
>>>> that have begun but not completed execution in the current thread. This
>>>> process continues until a handler is found that indicates that it
>> handles
>>>> that particular exception by naming the class of the exception or a
>>>> superclass of the class of the exception (§11.2 <
>>>> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.2
>>> ).
>>>> If no such handler is found, then the exception may be handled by one
>> of a
>>>> hierarchy of uncaught exception handlers (§11.3 <
>>>> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.3
>>> )
>>>> - thus every effort is made to avoid letting an exception go unhandled.
>>>>
>>>> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html <
>>>> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html>
>>>>
>>>>
>>>> François
>>>>
>>>>
>>>>
>>>>> Le 30 mai 2020 à 16:52, smallufo <sm...@gmail.com> a écrit :
>>>>>
>>>>> Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六
>> 下午10:48寫道:
>>>>>> sompage?67-1.-border-content-border_body-form is the path to your
>> model
>>>>> Yes , but it may contains deep-nested model
>>>>>
>>>>> The form contains FormComponentPanel and contains another
>>>>> FormComponentPanels and widgets , very deep ...
>>>>> The error may lay under very deep model , which is very hard to debug.
>>>>> And the error message should be able to pinpoint which model causes the
>>>>> problem
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>

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


Re: Locatable UnsupportedOperationException

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I like the idea to catch UnsupportedOperationException at
org.apache.wicket.IGenericComponent#setModelObject(T) and re-throw it as:
throw new WicketRuntimeException("You need to use read/write Model for
component '{}", this.getPageRelativePath(), uox)

Does anyone see a drawback ?

Martin

On Sat, May 30, 2020 at 11:42 PM Sven Meier <sv...@meiers.net> wrote:

> Hi,
>
> just put a breakpoint on IModel#setObject().
>
> Once your problem hits that breakpoint, you'll be able to derive the
> offending component/model from the stacktrace/variables in your favorite
> IDE.
>
> Have fun
> Sven
>
>
> On 30.05.20 17:13, smallufo wrote:
> > Is it possible to try { setObjectObject(value) } catch { e }
> > and pinpoint which class/model causes this problem ?
> > Or is it too costly ?
> >
> >
> > Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六 下午11:02寫道:
> >
> >> Hope that help
> >>
> >> During the process of throwing an exception, the Java Virtual Machine
> >> abruptly completes, one by one, any expressions, statements, method and
> >> constructor invocations, initializers, and field initialization
> expressions
> >> that have begun but not completed execution in the current thread. This
> >> process continues until a handler is found that indicates that it
> handles
> >> that particular exception by naming the class of the exception or a
> >> superclass of the class of the exception (§11.2 <
> >> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.2
> >).
> >> If no such handler is found, then the exception may be handled by one
> of a
> >> hierarchy of uncaught exception handlers (§11.3 <
> >> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.3
> >)
> >> - thus every effort is made to avoid letting an exception go unhandled.
> >>
> >> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html <
> >> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html>
> >>
> >>
> >> François
> >>
> >>
> >>
> >>> Le 30 mai 2020 à 16:52, smallufo <sm...@gmail.com> a écrit :
> >>>
> >>> Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六
> 下午10:48寫道:
> >>>
> >>>> sompage?67-1.-border-content-border_body-form is the path to your
> model
> >>>>
> >>> Yes , but it may contains deep-nested model
> >>>
> >>> The form contains FormComponentPanel and contains another
> >>> FormComponentPanels and widgets , very deep ...
> >>> The error may lay under very deep model , which is very hard to debug.
> >>> And the error message should be able to pinpoint which model causes the
> >>> problem
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Locatable UnsupportedOperationException

Posted by Sven Meier <sv...@meiers.net>.
Hi,

just put a breakpoint on IModel#setObject().

Once your problem hits that breakpoint, you'll be able to derive the 
offending component/model from the stacktrace/variables in your favorite 
IDE.

Have fun
Sven


On 30.05.20 17:13, smallufo wrote:
> Is it possible to try { setObjectObject(value) } catch { e }
> and pinpoint which class/model causes this problem ?
> Or is it too costly ?
>
>
> Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六 下午11:02寫道:
>
>> Hope that help
>>
>> During the process of throwing an exception, the Java Virtual Machine
>> abruptly completes, one by one, any expressions, statements, method and
>> constructor invocations, initializers, and field initialization expressions
>> that have begun but not completed execution in the current thread. This
>> process continues until a handler is found that indicates that it handles
>> that particular exception by naming the class of the exception or a
>> superclass of the class of the exception (§11.2 <
>> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.2>).
>> If no such handler is found, then the exception may be handled by one of a
>> hierarchy of uncaught exception handlers (§11.3 <
>> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.3>)
>> - thus every effort is made to avoid letting an exception go unhandled.
>>
>> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html <
>> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html>
>>
>>
>> François
>>
>>
>>
>>> Le 30 mai 2020 à 16:52, smallufo <sm...@gmail.com> a écrit :
>>>
>>> Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六 下午10:48寫道:
>>>
>>>> sompage?67-1.-border-content-border_body-form is the path to your model
>>>>
>>> Yes , but it may contains deep-nested model
>>>
>>> The form contains FormComponentPanel and contains another
>>> FormComponentPanels and widgets , very deep ...
>>> The error may lay under very deep model , which is very hard to debug.
>>> And the error message should be able to pinpoint which model causes the
>>> problem
>>

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


Re: Locatable UnsupportedOperationException

Posted by smallufo <sm...@gmail.com>.
Is it possible to try { setObjectObject(value) } catch { e }
and pinpoint which class/model causes this problem ?
Or is it too costly ?


Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六 下午11:02寫道:

> Hope that help
>
> During the process of throwing an exception, the Java Virtual Machine
> abruptly completes, one by one, any expressions, statements, method and
> constructor invocations, initializers, and field initialization expressions
> that have begun but not completed execution in the current thread. This
> process continues until a handler is found that indicates that it handles
> that particular exception by naming the class of the exception or a
> superclass of the class of the exception (§11.2 <
> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.2>).
> If no such handler is found, then the exception may be handled by one of a
> hierarchy of uncaught exception handlers (§11.3 <
> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.3>)
> - thus every effort is made to avoid letting an exception go unhandled.
>
> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html <
> https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html>
>
>
> François
>
>
>
> > Le 30 mai 2020 à 16:52, smallufo <sm...@gmail.com> a écrit :
> >
> > Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六 下午10:48寫道:
> >
> >> sompage?67-1.-border-content-border_body-form is the path to your model
> >>
> >
> > Yes , but it may contains deep-nested model
> >
> > The form contains FormComponentPanel and contains another
> > FormComponentPanels and widgets , very deep ...
> > The error may lay under very deep model , which is very hard to debug.
> > And the error message should be able to pinpoint which model causes the
> > problem
>
>

Re: Locatable UnsupportedOperationException

Posted by Francois Meillet <fr...@gmail.com>.
Hope that help

During the process of throwing an exception, the Java Virtual Machine abruptly completes, one by one, any expressions, statements, method and constructor invocations, initializers, and field initialization expressions that have begun but not completed execution in the current thread. This process continues until a handler is found that indicates that it handles that particular exception by naming the class of the exception or a superclass of the class of the exception (§11.2 <https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.2>). If no such handler is found, then the exception may be handled by one of a hierarchy of uncaught exception handlers (§11.3 <https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html#jls-11.3>) - thus every effort is made to avoid letting an exception go unhandled. 
         
https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html <https://docs.oracle.com/javase/specs/jls/se11/html/jls-11.html>


François



> Le 30 mai 2020 à 16:52, smallufo <sm...@gmail.com> a écrit :
> 
> Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六 下午10:48寫道:
> 
>> sompage?67-1.-border-content-border_body-form is the path to your model
>> 
> 
> Yes , but it may contains deep-nested model
> 
> The form contains FormComponentPanel and contains another
> FormComponentPanels and widgets , very deep ...
> The error may lay under very deep model , which is very hard to debug.
> And the error message should be able to pinpoint which model causes the
> problem


Re: Locatable UnsupportedOperationException

Posted by smallufo <sm...@gmail.com>.
Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六 下午10:48寫道:

> sompage?67-1.-border-content-border_body-form is the path to your model
>

Yes , but it may contains deep-nested model

The form contains FormComponentPanel and contains another
FormComponentPanels and widgets , very deep ...
The error may lay under very deep model , which is very hard to debug.
And the error message should be able to pinpoint which model causes the
problem

Re: Locatable UnsupportedOperationException

Posted by Francois Meillet <fr...@gmail.com>.
sompage?67-1.-border-content-border_body-form is the path to your model

François



> Le 30 mai 2020 à 16:35, smallufo <sm...@gmail.com> a écrit :
> 
> well , in fact , there is no such information :
> All information are from wicket , no single line point to my package...
> 
> FYI :
> (wicket-8.6.0)
> 
> 2020-05-30 21:35:14.117 [http-nio-8080-exec-6] ERROR
> d.w.ExceptionPage.<init> - exception = Override this method to support
> setObject(Object) , url =
> http://localhost:8080/app/sompage?67-1.-border-content-border_body-form <http://localhost:8080/app/sompage?67-1.-border-content-border_body-form> .
> agent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36
> (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36 . referrer =
> http://localhost:8080/app/somepage <http://localhost:8080/app/somepage> . ip = 0:0:0:0:0:0:0:1
> 
> java.lang.UnsupportedOperationException: Override this method to support
> setObject(Object)
> 
>        at org.apache.wicket.model.IModel.setObject(IModel.java:84)
> 
>        at
> org.apache.wicket.Component.setDefaultModelObject(Component.java:3012)
> 
>        at
> org.apache.wicket.IGenericComponent.setModelObject(IGenericComponent.java:81)
> 
>        at
> org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1100)
> 
>        at
> org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223)
> 
>        at
> org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:193)
> 
>        at
> org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:274)
> 
>        at
> org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:262)
> 
>        at
> org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:262)
> 
>        at
> org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:245)
> 
>        at
> org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:426)
> 
>        at
> org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:1873)
> 
>        at
> org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:1838)
> 
>        at org.apache.wicket.markup.html.form.Form.process(Form.java:990)
> 
>        at
> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:825)
> 
>        at org.apache.wicket.markup.html.form.Form.onRequest(Form.java:726)
> 
>        at
> org.apache.wicket.core.request.handler.ListenerRequestHandler.internalInvoke(ListenerRequestHandler.java:306)
> 
>        at
> org.apache.wicket.core.request.handler.ListenerRequestHandler.invoke(ListenerRequestHandler.java:255)
> 
>        at
> org.apache.wicket.core.request.handler.ListenerRequestHandler.invokeListener(ListenerRequestHandler.java:215)
> 
>        at
> org.apache.wicket.core.request.handler.ListenerRequestHandler.respond(ListenerRequestHandler.java:208)
> 
>        at
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:914)
> 
>        at
> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)
> 
>        at
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:282)
> 
>        at
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)
> 
>        at
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)
> 
>        at
> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:275)
> 
>        at
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:206)
> 
>        at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:299)
> 
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
> 
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
> 
>        at
> org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:186)
> 
>        at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
> 
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
> 
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
> 
>        at
> org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:186)
> 
>        at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
> 
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
> 
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
> 
>        at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
> 
>        at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
> 
>        at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)
> 
>        at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
> 
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
> 
>        at
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
> 
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
> 
>        at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
> 
>        at
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:609)
> 
>        at
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
> 
>        at
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)
> 
>        at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1506)
> 
>        at
> org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
> 
>        at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> 
>        at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> 
>        at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> 
>        at java.base/java.lang.Thread.run(Thread.java:834)
> 
> Francois Meillet <francois.meillet@gmail.com <ma...@gmail.com>> 於 2020年5月30日 週六 下午10:29寫道:
> 
>> In your stacktrace, look at the line just below
>> org.apache.wicket.model.IModel.setObject(IModel.java:84)
>> You will find the cuprit
>> 
>> Exception in thread "main" java.lang.UnsupportedOperationException:
>> Override this method to support setObject(Object)
>>        at org.apache.wicket.model.IModel.setObject(IModel.java:84)
>>        at
>> xxx.yyyy.zzz.YourClassUsingThisModel.theMethod(YourClassUsingThisModel.java:12)
>> 
>> François
>> 
>> 
>> 
>>> Le 30 mai 2020 à 16:13, smallufo <sm...@gmail.com> a écrit :
>>> 
>>> Yes , I know...
>>> But I hope it will be more informative.
>>> Because in practice , there may be lots of models , nested panels , forms
>>> , even in one page...
>>> Informative error message can make us quickly understand which model
>> needs
>>> to implement setObject.
>>> (just like the un-serializable field error message)
>>> 
>>> Thanks.
>>> 
>>> 
>>> Francois Meillet <francois.meillet@gmail.com <ma...@gmail.com> <mailto:
>> francois.meillet@gmail.com>> 於 2020年5月30日 週六 下午9:58寫道:
>>> 
>>>> Hi,
>>>> 
>>>> Depending on the model you use, you may need to ovveride the setObject()
>>>> method.
>>>> 
>>>> from the API docs
>>>> 
>>>> default void setObject​(T object)
>>>> 
>>>> Throws:
>>>> UnsupportedOperationException - unless overridden
>>>> 
>>>> 
>>>> 
>>>> 
>> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T) <https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)>
>>>> <
>>>> 
>> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
>> <
>> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
>>> 
>>>>> 
>>>> 
>>>> 
>>>> François
>>>> 
>>>> 
>>>> 
>>>>> Le 30 mai 2020 à 15:46, smallufo <sm...@gmail.com> a écrit :
>>>>> 
>>>>> Hi
>>>>> I am building an app with complicated forms , nested models ...
>>>>> Some times it obsesses me is the UnsupportedOperationException :
>>>>> 
>>>>> java.lang.UnsupportedOperationException: Override this method to
>> support
>>>>> setObject(Object)
>>>>> 
>>>>> at org.apache.wicket.model.IModel.setObject(IModel.java:84)
>>>>> It doesn't pinpoint me which model , which form , which panel...
>>>>> very hard to debug...
>>>>> For non-serializable exception , it can provide meaning information ,
>>>> even
>>>>> pinpoint which field causes the problem.
>>>>> I hope some day , this UnsupportedOperationException can also be so
>>>>> informative.
>>>>> 
>>>>> Thanks.


Re: Locatable UnsupportedOperationException

Posted by smallufo <sm...@gmail.com>.
well , in fact , there is no such information :
All information are from wicket , no single line point to my package...

FYI :
(wicket-8.6.0)

2020-05-30 21:35:14.117 [http-nio-8080-exec-6] ERROR
d.w.ExceptionPage.<init> - exception = Override this method to support
setObject(Object) , url =
http://localhost:8080/app/sompage?67-1.-border-content-border_body-form .
agent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36 . referrer =
http://localhost:8080/app/somepage . ip = 0:0:0:0:0:0:0:1

java.lang.UnsupportedOperationException: Override this method to support
setObject(Object)

        at org.apache.wicket.model.IModel.setObject(IModel.java:84)

        at
org.apache.wicket.Component.setDefaultModelObject(Component.java:3012)

        at
org.apache.wicket.IGenericComponent.setModelObject(IGenericComponent.java:81)

        at
org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1100)

        at
org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223)

        at
org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:193)

        at
org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:274)

        at
org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:262)

        at
org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:262)

        at
org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:245)

        at
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:426)

        at
org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:1873)

        at
org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:1838)

        at org.apache.wicket.markup.html.form.Form.process(Form.java:990)

        at
org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:825)

        at org.apache.wicket.markup.html.form.Form.onRequest(Form.java:726)

        at
org.apache.wicket.core.request.handler.ListenerRequestHandler.internalInvoke(ListenerRequestHandler.java:306)

        at
org.apache.wicket.core.request.handler.ListenerRequestHandler.invoke(ListenerRequestHandler.java:255)

        at
org.apache.wicket.core.request.handler.ListenerRequestHandler.invokeListener(ListenerRequestHandler.java:215)

        at
org.apache.wicket.core.request.handler.ListenerRequestHandler.respond(ListenerRequestHandler.java:208)

        at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:914)

        at
org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)

        at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:282)

        at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)

        at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)

        at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:275)

        at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:206)

        at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:299)

        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

        at
org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:186)

        at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)

        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

        at
org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:186)

        at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)

        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)

        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)

        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)

        at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)

        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)

        at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:609)

        at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)

        at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)

        at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1506)

        at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

        at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

        at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

        at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

        at java.base/java.lang.Thread.run(Thread.java:834)

Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六 下午10:29寫道:

> In your stacktrace, look at the line just below
> org.apache.wicket.model.IModel.setObject(IModel.java:84)
> You will find the cuprit
>
> Exception in thread "main" java.lang.UnsupportedOperationException:
> Override this method to support setObject(Object)
>         at org.apache.wicket.model.IModel.setObject(IModel.java:84)
>         at
> xxx.yyyy.zzz.YourClassUsingThisModel.theMethod(YourClassUsingThisModel.java:12)
>
> François
>
>
>
> > Le 30 mai 2020 à 16:13, smallufo <sm...@gmail.com> a écrit :
> >
> > Yes , I know...
> > But I hope it will be more informative.
> > Because in practice , there may be lots of models , nested panels , forms
> > , even in one page...
> > Informative error message can make us quickly understand which model
> needs
> > to implement setObject.
> > (just like the un-serializable field error message)
> >
> > Thanks.
> >
> >
> > Francois Meillet <francois.meillet@gmail.com <mailto:
> francois.meillet@gmail.com>> 於 2020年5月30日 週六 下午9:58寫道:
> >
> >> Hi,
> >>
> >> Depending on the model you use, you may need to ovveride the setObject()
> >> method.
> >>
> >> from the API docs
> >>
> >> default void setObject​(T object)
> >>
> >> Throws:
> >> UnsupportedOperationException - unless overridden
> >>
> >>
> >>
> >>
> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
> >> <
> >>
> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
> <
> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
> >
> >>>
> >>
> >>
> >> François
> >>
> >>
> >>
> >>> Le 30 mai 2020 à 15:46, smallufo <sm...@gmail.com> a écrit :
> >>>
> >>> Hi
> >>> I am building an app with complicated forms , nested models ...
> >>> Some times it obsesses me is the UnsupportedOperationException :
> >>>
> >>> java.lang.UnsupportedOperationException: Override this method to
> support
> >>> setObject(Object)
> >>>
> >>> at org.apache.wicket.model.IModel.setObject(IModel.java:84)
> >>> It doesn't pinpoint me which model , which form , which panel...
> >>> very hard to debug...
> >>> For non-serializable exception , it can provide meaning information ,
> >> even
> >>> pinpoint which field causes the problem.
> >>> I hope some day , this UnsupportedOperationException can also be so
> >>> informative.
> >>>
> >>> Thanks.
>
>

Re: Locatable UnsupportedOperationException

Posted by Francois Meillet <fr...@gmail.com>.
In your stacktrace, look at the line just below org.apache.wicket.model.IModel.setObject(IModel.java:84)
You will find the cuprit

Exception in thread "main" java.lang.UnsupportedOperationException: Override this method to support setObject(Object)
	at org.apache.wicket.model.IModel.setObject(IModel.java:84)
	at xxx.yyyy.zzz.YourClassUsingThisModel.theMethod(YourClassUsingThisModel.java:12)

François



> Le 30 mai 2020 à 16:13, smallufo <sm...@gmail.com> a écrit :
> 
> Yes , I know...
> But I hope it will be more informative.
> Because in practice , there may be lots of models , nested panels , forms
> , even in one page...
> Informative error message can make us quickly understand which model needs
> to implement setObject.
> (just like the un-serializable field error message)
> 
> Thanks.
> 
> 
> Francois Meillet <francois.meillet@gmail.com <ma...@gmail.com>> 於 2020年5月30日 週六 下午9:58寫道:
> 
>> Hi,
>> 
>> Depending on the model you use, you may need to ovveride the setObject()
>> method.
>> 
>> from the API docs
>> 
>> default void setObject​(T object)
>> 
>> Throws:
>> UnsupportedOperationException - unless overridden
>> 
>> 
>> 
>> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
>> <
>> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T) <https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)>
>>> 
>> 
>> 
>> François
>> 
>> 
>> 
>>> Le 30 mai 2020 à 15:46, smallufo <sm...@gmail.com> a écrit :
>>> 
>>> Hi
>>> I am building an app with complicated forms , nested models ...
>>> Some times it obsesses me is the UnsupportedOperationException :
>>> 
>>> java.lang.UnsupportedOperationException: Override this method to support
>>> setObject(Object)
>>> 
>>> at org.apache.wicket.model.IModel.setObject(IModel.java:84)
>>> It doesn't pinpoint me which model , which form , which panel...
>>> very hard to debug...
>>> For non-serializable exception , it can provide meaning information ,
>> even
>>> pinpoint which field causes the problem.
>>> I hope some day , this UnsupportedOperationException can also be so
>>> informative.
>>> 
>>> Thanks.


Re: Locatable UnsupportedOperationException

Posted by smallufo <sm...@gmail.com>.
Yes , I know...
But I hope it will be more informative.
Because in practice , there may be lots of models , nested panels , forms
, even in one page...
Informative error message can make us quickly understand which model needs
to implement setObject.
(just like the un-serializable field error message)

Thanks.


Francois Meillet <fr...@gmail.com> 於 2020年5月30日 週六 下午9:58寫道:

> Hi,
>
> Depending on the model you use, you may need to ovveride the setObject()
> method.
>
> from the API docs
>
> default void setObject​(T object)
>
> Throws:
> UnsupportedOperationException - unless overridden
>
>
>
> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
> <
> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
> >
>
>
> François
>
>
>
> > Le 30 mai 2020 à 15:46, smallufo <sm...@gmail.com> a écrit :
> >
> > Hi
> > I am building an app with complicated forms , nested models ...
> > Some times it obsesses me is the UnsupportedOperationException :
> >
> > java.lang.UnsupportedOperationException: Override this method to support
> > setObject(Object)
> >
> > at org.apache.wicket.model.IModel.setObject(IModel.java:84)
> > It doesn't pinpoint me which model , which form , which panel...
> > very hard to debug...
> > For non-serializable exception , it can provide meaning information ,
> even
> > pinpoint which field causes the problem.
> > I hope some day , this UnsupportedOperationException can also be so
> > informative.
> >
> > Thanks.
>
>

Re: Locatable UnsupportedOperationException

Posted by Francois Meillet <fr...@gmail.com>.
Hi,

Depending on the model you use, you may need to ovveride the setObject() method.

from the API docs

default void setObject​(T object)

Throws:
UnsupportedOperationException - unless overridden


https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T) <https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)>


François



> Le 30 mai 2020 à 15:46, smallufo <sm...@gmail.com> a écrit :
> 
> Hi
> I am building an app with complicated forms , nested models ...
> Some times it obsesses me is the UnsupportedOperationException :
> 
> java.lang.UnsupportedOperationException: Override this method to support
> setObject(Object)
> 
> at org.apache.wicket.model.IModel.setObject(IModel.java:84)
> It doesn't pinpoint me which model , which form , which panel...
> very hard to debug...
> For non-serializable exception , it can provide meaning information , even
> pinpoint which field causes the problem.
> I hope some day , this UnsupportedOperationException can also be so
> informative.
> 
> Thanks.