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

carloscz25

Members
  • Posts

    2
  • Joined

  • Last visited

carloscz25's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi, since running subreports involves multithreading, I am running into an issue when producing certain reports, but not all, that include SUBREPORTS. The point is that the host platform (CUBA Platform) throws an IllegalStateException when calling Service methods from a subreport thread. I presume that for one-level reports the main thread is the same main thread running the middleware and therefore it arises no problem for subreport-less reports. However this is not 100% true, then I have one report with nested subreports which calls Service methods as well, but no problem arises. For the affected reports, when running a subreport (presuming from a subreport thread) the following exception arises: java.lang.SecurityException: No security context bound to the current thread at com.haulmont.cuba.core.sys.AppContext.getSecurityContextNN(AppContext.java:153) at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:85) at sun.reflect.GeneratedMethodAccessor108.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:175) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy256.getFechaDevuelto(Unknown Source) at com.company.test1.service.accessory.HlpRecibo.getFechaDevuelto(HlpRecibo.java:107) 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 com.company.test1.service.accessory.SIJRBeanDataSource.getFieldValue_(SIJRBeanDataSource.java:94) at com.company.test1.service.accessory.SIJRBeanDataSource.getFieldValue(SIJRBeanDataSource.java:67) at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:1501) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1402) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1378) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1194) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:108) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:615) at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:432) at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:818) at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:61) at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:221) 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)[/code]As I said, this doesn't happen with all reports that contain subreports, but this cause seems to be the main one. So either the report containing subreports uses only the main thread, or the failure is due to any other reason. Is there the possibility to some how include a couple of lines of code in the thread to apply a securitycontext provided by the host platform? Additionally, is there another besides setting Jasperreports to single-threaded mode, to prevent from multithreading? Or something in the report I can somehow tweak? I have inspected reports (all including subreports) both working and failing, and at first sight nothing seems to affect the usage of a separate thread. Deactivating multithreading is not an option then in parallel I have read performance degrades substantially. Many thanks for your time and attention. Regards, Carlos Conti.
  2. Hi there, I have been some hours struggling with this question but can't find any clues in the internet to help me out. the point is that I want to build a flexible way of building a kind of "report components" to separately fill them and then build a master one. this is becasuse I want to run it in automated fashion, and I don't know in advance which how many nesting levels I will face. Therefore the solution is to run it in a bottom-up way so I begin from the ground and then "compose" the master report with the pre-filled subreports. I haven't found anywhere a solution for this problem, for all the solutions consist of passing the mainreport all the data it needs to build the subreports, and the compiled versions of the involved subreports, but what I would like is to build them the other way around, from the subreports to the main report. I have read some documentation, and as far as it seems I cannot use JasperPrint, then it includes much information of the printed output, besides not being apparently accepted as a parameter at report production. Any ideas are more than greatly welcome. Many thanks in advance, Carlos.
×
×
  • Create New...