Jump to content
We've recently updated our Privacy Statement, available here ×

How to fill a report using data from a JSON Data Source in Jasper Server?


lima.juliocarlos

Recommended Posts

I'm trying to fill a report using data from a JSON datasource in Jasper Server 8.1.0 (Community Edition). In JasperStudio (6.20) everything works fine, but when I publish the report on Jasper Server, I'm getting an error.

Steps to reproduce the issue:

In JasperStudio:

  1. Create a new data adapter with these properties:
  1. copy the attached JRXML file to your Project Explorer

Preview the report on JasperStudio. Everything must work fine.

In Jasper Server:

Create a new data source with the following properties:

Click "Save" button, then:

  • Data Source Name: ds_People
  • Resource ID: ds_People

Click "Save" button.

Go back to Jasper Studio and publish the report on Jasper Server. In Datasource tab, select "Data Source from repository" and chose the previously created data source. Then, click "Finish".

All these steps seem to be ok. However, when I go to Jasper Server and try to execute the report, I get an error: "There was an error on the server. Try again or contact site administrators." Checking logs, this error's stacktrace is:

 

2022-11-04T16:05:20,562 ERROR SecureExceptionHandlerImpl,pool-69-thread-7:125 - There was an error on the server. Try again or contact site administrators. (Error UID: 9fdea358-c9b5-442b-9b9a-b19d80d689ab). Teiid  Virtual Data Source Query Service - unsupported data source: ds_people com.jaspersoft.jasperserver.api.JSExceptionWrapper: com.jaspersoft.jasperserver.api.common.virtualdatasourcequery.VirtualDataSourceException: Teiid  Virtual Data Source Query Service - unsupported data source: ds_people    at com.jaspersoft.jasperserver.api.engine.common.virtualdatasourcequery.impl.TeiidVirtualDataSourceQueryServiceImpl.getDataSource(TeiidVirtualDataSourceQueryServiceImpl.java:822)    at com.jaspersoft.jasperserver.api.engine.common.virtualdatasourcequery.impl.TeiidVirtualDataSourceQueryServiceImpl.getConnectionFactory(TeiidVirtualDataSourceQueryServiceImpl.java:800)    at com.jaspersoft.jasperserver.api.engine.common.virtualdatasourcequery.impl.TeiidVirtualDataSourceQueryServiceImpl.addSubDataSource(TeiidVirtualDataSourceQueryServiceImpl.java:540)    at com.jaspersoft.jasperserver.api.engine.common.virtualdatasourcequery.impl.AbstractVirtualDataSourceQueryServiceImpl.addOrMarkSubDataSource(AbstractVirtualDataSourceQueryServiceImpl.java:176)    at com.jaspersoft.jasperserver.api.engine.common.virtualdatasourcequery.impl.AbstractVirtualDataSourceQueryServiceImpl.getConnectionFactory(AbstractVirtualDataSourceQueryServiceImpl.java:99)    at com.jaspersoft.jasperserver.api.engine.common.virtualdatasourcequery.VirtualDataSourceHandler.getSqlDataSource(VirtualDataSourceHandler.java:160)    at com.jaspersoft.jasperserver.api.engine.jasperreports.util.CustomJDBCReportDataSourceServiceFactory.createService(CustomJDBCReportDataSourceServiceFactory.java:83)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:498)    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:100)    at com.jaspersoft.jasperserver.api.metadata.user.service.impl.ProfileAttributesResolverAspect.resolveDataSourceAttributes(ProfileAttributesResolverAspect.java:56)    at sun.reflect.GeneratedMethodAccessor1526.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:498)    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)    at com.sun.proxy.$Proxy738.createService(Unknown Source)    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.CustomReportDataSourceServiceFactory.createService(CustomReportDataSourceServiceFactory.java:106)    at com.jaspersoft.jasperserver.api.metadata.jasperreports.service.ReportDataSourceServiceFactory.createService(ReportDataSourceServiceFactory.java:55)    at com.jaspersoft.jasperserver.api.metadata.jasperreports.service.ReportDataSourceServiceFactory$$FastClassBySpringCGLIB$$26c7350e.invoke(<generated>)    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:100)    at com.jaspersoft.jasperserver.api.metadata.user.service.impl.ProfileAttributesResolverAspect.resolveDataSourceAttributes(ProfileAttributesResolverAspect.java:56)    at sun.reflect.GeneratedMethodAccessor1526.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:498)    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.CustomReportDataSourceServiceFactory$$EnhancerBySpringCGLIB$$5ee4e5f7.createService(<generated>)    at com.jaspersoft.jasperserver.api.metadata.jasperreports.service.ReportDataSourceServiceFactory$$FastClassBySpringCGLIB$$26c7350e.invoke(<generated>)    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.CustomReportDataSourceServiceFactory$$EnhancerBySpringCGLIB$$e59f169e.createService(<generated>)    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.createDataSourceService(EngineServiceImpl.java:2078)    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1874)    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runWithDataSource(EngineServiceImpl.java:1185)    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1122)    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:997)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)    at java.lang.Thread.run(Thread.java:748)2022-11-04T16:05:20,562 ERROR SecureExceptionHandlerImpl,pool-69-thread-8:125 - There was an error on the server. Try again or contact site administrators. (Error UID: f69d389f-d363-464d-9481-2db71d464bc6) com.jaspersoft.jasperserver.api.ErrorDescriptorException: There was an error on the server. Try again or contact site administrators. (Error UID: 9fdea358-c9b5-442b-9b9a-b19d80d689ab)    at com.jaspersoft.jasperserver.remote.services.ReportExecution.getFinalReportUnitResult(ReportExecution.java:173)    at com.jaspersoft.jasperserver.remote.services.impl.RunReportServiceImpl$2.run(RunReportServiceImpl.java:498)    at com.jaspersoft.jasperserver.api.logging.util.LoggableExecutorService$1.run(LoggableExecutorService.java:84)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)    at java.lang.Thread.run(Thread.java:748)

 

I've already tried a lot of configurations and workarounds. Unfortunately, nothing seems to work. What am I doing wrong?

Thanks in advance for any help.

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

It's still not working for me. Did you reproduce this tutorial on the same versions of JasperStudio and JasperServer that I'm using? I think this tutorial is for another version of these tools, because the steps are slightly different when I tried to follow them.

For example: when exporting the data adapter, it is saved as JRDAX file. When publishing report on JasperServer, a popup is open, asking me which datasource to use, even after I set the report property as shown in the tutorial.

After publishing the report, I needed to set datasource manually on the published report. When I execute the report, a get a new error:
 

2022-11-07T09:54:32,468 ERROR SecureExceptionHandlerImpl,pool-9-thread-15:125 - There was an error on the server. Try again or contact site administrators. (Error UID: 1c1b87c1-ffbd-41e1-98c4-bc33f48b0033) java.lang.ClassCastException: com.jaspersoft.jasperserver.api.metadata.common.domain.client.FileResourceImpl cannot be cast to com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportDataSource    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.<init>(EngineServiceImpl.java:1056)    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:677)    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.executeReportUnitRequest(EngineServiceImpl.java:2176)    at com.jaspersoft.jasperserver.api.engine.jasperreports.domain.impl.ReportUnitRequest.execute(ReportUnitRequest.java:75)    at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.execute(EngineServiceImpl.java:551)    at com.jaspersoft.jasperserver.remote.services.impl.ReportExecutorImpl$GenericRunReportStrategy.runReport(ReportExecutorImpl.java:247)    at com.jaspersoft.jasperserver.remote.services.impl.ReportExecutorImpl.runReport(ReportExecutorImpl.java:129)    at com.jaspersoft.jasperserver.remote.services.impl.RunReportServiceImpl$1.run(RunReportServiceImpl.java:337)    at com.jaspersoft.jasperserver.api.logging.util.LoggableExecutorService$1.run(LoggableExecutorService.java:84)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)    at java.lang.Thread.run(Thread.java:748)2022-11-07T09:54:32,469 ERROR SecureExceptionHandlerImpl,pool-9-thread-16:125 - There was an error on the server. Try again or contact site administrators. (Error UID: 89241388-4fcb-46d2-926d-5455d3b6f38c) com.jaspersoft.jasperserver.api.ErrorDescriptorException: There was an error on the server. Try again or contact site administrators. (Error UID: 1c1b87c1-ffbd-41e1-98c4-bc33f48b0033)    at com.jaspersoft.jasperserver.remote.services.ReportExecution.getFinalReportUnitResult(ReportExecution.java:173)    at com.jaspersoft.jasperserver.remote.services.impl.RunReportServiceImpl$2.run(RunReportServiceImpl.java:498)    at com.jaspersoft.jasperserver.api.logging.util.LoggableExecutorService$1.run(LoggableExecutorService.java:84)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)    at java.lang.Thread.run(Thread.java:748)

 

If you can, try to reproduce the tutorial in JasperStudio 6.20 and JasperServer 8.1.0.

Thanks in advance!

Link to comment
Share on other sites

  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...