More than one value of type [net.sf.jasperreports.engine.JRDataSource] found
I getting this exception while using a subreport in my jasper report and trying to pass a datasource for my subreport. Datasource for report is ‘datasource’ and datasource for subreport is ‘pardatasource’.
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: More than one value of type [net.sf.jasperreports.engine.JRDataSource] found org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:488) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) com.ccclogic.core.filter.SessionTimeoutFilter.doFilter(SessionTimeoutFilter.java:127)
July 28, 2009 | Filed Under Exception
Related Post
Comments
One Response to “More than one value of type [net.sf.jasperreports.engine.JRDataSource] found”
Leave a Reply
Since you are using two datasource for your report. You must tell jasper a default datasource for main report. This can be specified by using reportDataKey
testReport.class=org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView
testReport.url=reports/testReport.jasper
testReport.reportDataKey=datasource
This test report is using reportDataKey to specify datasource used by report.
Let me know if there is any problem you are facing regarding this issue.