Re: Locatable UnsupportedOperationException

2020-05-30 Thread Sven Meier

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  於 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  a écrit :

Francois Meillet  於 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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Locatable UnsupportedOperationException

2020-05-30 Thread smallufo
Is it possible to try { setObjectObject(value) } catch { e }
and pinpoint which class/model causes this problem ?
Or is it too costly ?


Francois Meillet  於 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  a écrit :
> >
> > Francois Meillet  於 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

2020-05-30 Thread Francois Meillet
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 
). If 
no such handler is found, then the exception may be handled by one of a 
hierarchy of uncaught exception handlers (§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 



François



> Le 30 mai 2020 à 16:52, smallufo  a écrit :
> 
> Francois Meillet  於 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

2020-05-30 Thread smallufo
Francois Meillet  於 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

2020-05-30 Thread Francois Meillet
sompage?67-1.-border-content-border_body-form is the path to your model

François



> Le 30 mai 2020 à 16:35, smallufo  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. - 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
> 

Re: Locatable UnsupportedOperationException

2020-05-30 Thread smallufo
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. - 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

Re: Locatable UnsupportedOperationException

2020-05-30 Thread Francois Meillet
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..zzz.YourClassUsingThisModel.theMethod(YourClassUsingThisModel.java:12)

François



> Le 30 mai 2020 à 16:13, smallufo  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  > 於 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  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

2020-05-30 Thread smallufo
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  於 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  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

2020-05-30 Thread Francois Meillet
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)
 



François



> Le 30 mai 2020 à 15:46, smallufo  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.



Locatable UnsupportedOperationException

2020-05-30 Thread smallufo
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.