when i run report in local, i get file report but when i run report in product enviroment, i get error:
io.jmix.reports.exception.ReportingException: Error formatting jasper report: Errors were encountered when compiling report expressions class file:
/deployments/khe_uoc_giai_ngan_nhan_no_1695961748409_45820.java:18: error: cannot find symbol
public class khe_uoc_giai_ngan_nhan_no_1695961748409_45820 extends JREvaluator
^
symbol: class JREvaluator
/deployments/khe_uoc_giai_ngan_nhan_no_1695961748409_45820.java:25: error: cannot find symbol
private JRFillParameter parameter_IS_IGNORE_PAGINATION = null;
^
symbol: class JRFillParameter
location: class khe_uoc_giai_ngan_nhan_no_1695961748409_45820
/deployments/khe_uoc_giai_ngan_nhan_no_1695961748409_45820.java:26: error: cannot find symbol
private JRFillParameter parameter_REPORT_CONNECTION = null;
^
…
Some one help me? (sorry for my poor english)
Hello,
What version of Jmix are you using? How do you deploy an application to production?
Regards,
Nikita
Hi Nikita,
i’m using jmix 1.5, i used docker to deploy an application.
thanks for your support!
Hello,
I found a solution to your problem.
The error occurs because JasperReport is trying to compile the report template, but javac
is not available to it. To do this, you need to create a docker image with JDK.
For example, Dockerfile:
FROM amazoncorretto:11-alpine-jdk
WORKDIR /app
COPY build/libs/jmix-reports-v1-0.0.1-SNAPSHOT.jar /app
RUN apk add --no-cache msttcorefonts-installer fontconfig
RUN update-ms-fonts
ENTRYPOINT ["java", "-jar", "/app/jmix-reports-v1-0.0.1-SNAPSHOT.jar"]
When building an image, it is also important to install fonts.
And in the dependencies you need to add a dependency on jasperreports:
implementation 'net.sf.jasperreports:jasperreports:6.20.0'
Regards,
Nikita
i will try. Thank u very much.
Best wishes,
TienNH
1 Like