jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
692 stars 124 forks source link

Report generation fails if nested collection of entity parameter is not java.util.List #3865

Open m-orlova opened 5 days ago

m-orlova commented 5 days ago

Environment

Jmix version: 1.6.1

Bug Description

See forum topic The problem relates to #1705.

Steps To Reproduce

  1. Open sample project
  2. Import report: Report for entity Order.zip
  3. Run report

Current Behavior

Report generation fails with exception image

io.jmix.reports.exception.ReportingException: An error occurred while loading data for band [OrderItems2] and query [Dataset]. Report name [Report for entity "Order"]
class org.eclipse.persistence.indirection.IndirectSet cannot be cast to class java.util.List (org.eclipse.persistence.indirection.IndirectSet is in unnamed module of loader 'app'; java.util.List is in module java.base of loader 'bootstrap')
    at io.jmix.reports.runner.impl.ReportRunnerImpl.createReportDocumentInternal(ReportRunnerImpl.java:169)
    at io.jmix.reports.runner.impl.ReportRunnerImpl.run(ReportRunnerImpl.java:90)
    at io.jmix.reportsui.runner.impl.UiReportRunnerImpl.runAndShow(UiReportRunnerImpl.java:98)
    at io.jmix.reportsui.runner.FluentUiReportRunner.runAndShow(FluentUiReportRunner.java:185)
    at io.jmix.reportsui.screen.report.run.InputParametersDialog.onPrintReportButtonClick(InputParametersDialog.java:136)
    at io.jmix.core.common.event.EventHub.publish(EventHub.java:170)
    at io.jmix.ui.component.impl.AbstractComponent.publish(AbstractComponent.java:85)
    at io.jmix.ui.component.impl.ButtonImpl.buttonClicked(ButtonImpl.java:78)
    at io.jmix.ui.widget.JmixButton.fireClick(JmixButton.java:77)
    at com.vaadin.ui.Button$1.click(Button.java:57)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:153)
    at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:115)
    at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:442)

Expected Behavior

Report is successfully generated.

Sample Project

reports-collection-fetchplan.zip

knstvk commented 3 days ago

Check in 2.4 too.