wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francois Meillet <francois.meil...@gmail.com>
Subject Re: Locatable UnsupportedOperationException
Date Sat, 30 May 2020 14:28:52 GMT
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 <smallufo@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 <smallufo@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.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message