Problem with Reports after upgrade to 7.0 version

Hello!

Thereis error with running reports after upgrade

    com.haulmont.reports.exception.ReportingException: An error occurred while loading data for band [Root] and query [FileName]. Report name [Отчёт универсальный (Города)  [NEW]]
    An error occurred while loading data for data set [FileName]
    No signature of method: java.util.Date.format() is applicable for argument types: (String) values: [YYYYMMdd]
    Possible solutions: from(java.time.Instant), toYear(), getAt(java.lang.String), parse(java.lang.String), print(java.lang.Object), print(java.io.PrintWriter)
    	at com.haulmont.reports.ReportingBean.createReportDocument(ReportingBean.java:372)
    	at com.haulmont.reports.ReportingBean.createReportDocument(ReportingBean.java:315)
    	at com.haulmont.reports.ReportingBean.createReport(ReportingBean.java:223)
    	at com.haulmont.reports.ReportServiceBean.createReport(ReportServiceBean.java:56)
    	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:343)
    	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:88)
    	at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:116)
    	at sun.reflect.GeneratedMethodAccessor262.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.$Proxy431.createReport(Unknown Source)
    	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.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:94)
    	at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:154)
    	at com.sun.proxy.$Proxy69.createReport(Unknown Source)
    	at com.haulmont.reports.gui.ReportGuiManager.getReportResult(ReportGuiManager.java:285)
    	at com.haulmont.reports.gui.ReportGuiManager$1.run(ReportGuiManager.java:416)
    	at com.haulmont.reports.gui.ReportGuiManager$1.run(ReportGuiManager.java:411)
    	at com.haulmont.cuba.gui.backgroundwork.LocalizedTaskWrapper.run(LocalizedTaskWrapper.java:57)
    	at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.call(WebBackgroundWorker.java:205)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.lambda$startExecution$1(WebBackgroundWorker.java:376)
    	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)

In report, I use such constructions
params[‘date_from’].format(‘YYYYMMdd’)

param date_from is Date type. Also doesnt work Date.plus() method.

No signature of method: java.util.Date.plus() is applicable for argument types: (Integer) values: [1]
Possible solutions: parse(java.lang.String), is(java.lang.Object), split(groovy.lang.Closure), use([Ljava.lang.Object;), wait(), clone()

Problem resolved. Added to global dependencies build.gradle

compile 'org.codehaus.groovy:groovy-all:2.5.4'
compile 'org.codehaus.groovy:groovy-dateutil:2.5.4'

http://groovy-lang.org/releasenotes/groovy-2.5.html#Groovy2.5releasenotes-Breakingchanges

The extension methods for the java.util.Date class are now in a separate groovy-dateutil module which isn’t included by default when using the groovy-all pom dependency. Add the additional module as a dependency if you need it or consider migrating to the java.time JSR-310 classes (similar Groovy extension methods exist for those classes and they are included by default when using the groovy-all pom dependency)

2 Likes