IllegalArgumentException: Unable to serialize When genericFilter in urlQueryParameters

Jmix 2.3.0

When I try to filter on a reference using the “in” comparison and the list page has genericFilter as part of the urlQueryParameters, then I get this exception. The filtering appears to work, however. If I remove the genericFilter element from the query parameters, then there is no error. In case it matters, my entity IDs are Integer types.

java.lang.IllegalArgumentException: Unable to serialize value 'org.ajjf.membership.entity.Region-1 [detached]' of type 'class org.ajjf.membership.entity.Region'
	at io.jmix.flowui.view.navigation.UrlParamSerializer.serialize(UrlParamSerializer.java:167) ~[jmix-flowui-2.3.0.jar:na]
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[na:na]
	at io.jmix.flowui.view.navigation.UrlParamSerializer.serializeCollection(UrlParamSerializer.java:239) ~[jmix-flowui-2.3.0.jar:na]
	at io.jmix.flowui.view.navigation.UrlParamSerializer.serialize(UrlParamSerializer.java:159) ~[jmix-flowui-2.3.0.jar:na]
	at io.jmix.flowui.facet.urlqueryparameters.GenericFilterUrlQueryParametersBinder.serializePropertyCondition(GenericFilterUrlQueryParametersBinder.java:173) ~[jmix-flowui-2.3.0.jar:na]
	at io.jmix.flowui.facet.urlqueryparameters.GenericFilterUrlQueryParametersBinder.updateQueryParameters(GenericFilterUrlQueryParametersBinder.java:150) ~[jmix-flowui-2.3.0.jar:na]
	at io.jmix.flowui.facet.urlqueryparameters.GenericFilterUrlQueryParametersBinder.onPostLoad(GenericFilterUrlQueryParametersBinder.java:120) ~[jmix-flowui-2.3.0.jar:na]
	at io.jmix.core.common.event.EventHub.publish(EventHub.java:172) ~[jmix-core-2.3.0.jar:na]
	at io.jmix.flowui.model.impl.CollectionLoaderImpl.sendPostLoadEvent(CollectionLoaderImpl.java:239) ~[jmix-flowui-2.3.0.jar:na]
	at io.jmix.flowui.model.impl.CollectionLoaderImpl._load(CollectionLoaderImpl.java:141) ~[jmix-flowui-2.3.0.jar:na]
	at io.jmix.flowui.model.impl.CollectionLoaderImpl.load(CollectionLoaderImpl.java:100) ~[jmix-flowui-2.3.0.jar:na]
	at io.jmix.flowui.component.filter.SingleFilterComponentBase.apply(SingleFilterComponentBase.java:210) ~[jmix-flowui-2.3.0.jar:na]
	at io.jmix.flowui.component.filter.SingleFilterComponentBase.onFilterValueChanged(SingleFilterComponentBase.java:110) ~[jmix-flowui-2.3.0.jar:na]
	at com.vaadin.flow.component.internal.AbstractFieldSupport.lambda$addValueChangeListener$828eca10$1(AbstractFieldSupport.java:98) ~[flow-server-24.3.10.jar:24.3.10]
	at com.vaadin.flow.component.ComponentEventBus.fireEventForListener(ComponentEventBus.java:239) ~[flow-server-24.3.10.jar:24.3.10]
	at com.vaadin.flow.component.ComponentEventBus.fireEvent(ComponentEventBus.java:228) ~[flow-server-24.3.10.jar:24.3.10]
	at com.vaadin.flow.component.Component.fireEvent(Component.java:411) ~[flow-server-24.3.10.jar:24.3.10]
	at com.vaadin.flow.component.ComponentUtil.fireEvent(ComponentUtil.java:416) ~[flow-server-24.3.10.jar:24.3.10]
	at com.vaadin.flow.component.internal.AbstractFieldSupport.setValue(AbstractFieldSupport.java:209) ~[flow-server-24.3.10.jar:24.3.10]
	at com.vaadin.flow.component.internal.AbstractFieldSupport.setModelValue(AbstractFieldSupport.java:169) ~[flow-server-24.3.10.jar:24.3.10]
	at com.vaadin.flow.component.AbstractField.setModelValue(AbstractField.java:225) ~[flow-server-24.3.10.jar:24.3.10]
	at io.jmix.flowui.component.filter.SingleFilterComponentBase.onFieldValueChanged(SingleFilterComponentBase.java:402) ~[jmix-flowui-2.3.0.jar:na]

Hi!

Thank you for your report. This is a bug, i created an issue to fix it: The entity collection can't be serialized for GenericFilterUrlQueryParameters · Issue #3492 · jmix-framework/jmix · GitHub

Regards,
Dmitriy