Содержание
- Error running report net.sf.jasperreports.engine.JRRuntimeException: Error initializing graphic environment. about bitnami-docker-jasperreports HOT 4 CLOSED
- Comments (4)
- Related Issues (20)
- Recommend Projects
- React
- Vue.js
- Typescript
- TensorFlow
- Django
- Laravel
- Recommend Topics
- javascript
- server
- Machine learning
- Visualization
- Recommend Org
- Microsoft
- erro ao executar: Error initializing graphic environment. #23
- Comments
- Error running any report «java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser» about bitnami-docker-jasperreports HOT 17 CLOSED
- Comments (17)
- Related Issues (20)
- Recommend Projects
- React
- Vue.js
- Typescript
- TensorFlow
- Django
- Laravel
- Recommend Topics
- javascript
- server
- Machine learning
- Visualization
- Recommend Org
- Microsoft
- erro na execuçãoException in thread «main» net.sf.jasperreports.engine.JRRuntimeException: Error initializing graphic environment. #183
- Comments
- Footer
Error running report net.sf.jasperreports.engine.JRRuntimeException: Error initializing graphic environment. about bitnami-docker-jasperreports HOT 4 CLOSED
Tried installing the following as well
yum install fontconfig
yum install urw-fonts
javsalgar commented on January 15, 2023
It definitely seems that we incorrectly removed the fontconfig package from the container. We will work on reenabling it again and let’s see if that’s enough to fix the issue.
javsalgar commented on January 15, 2023
Hi, we just released a new revision of the container with fontconfig.
Please let us know if the new container (make sure you remove the previous docker image) fixes the issue.
MariumHashmiBM commented on January 15, 2023
Hi, we just released a new revision of the container with fontconfig.
Please let us know if the new container (make sure you remove the previous docker image) fixes the issue.
Thanks for the update.
After removing image and re-deployment on server with the latest update, it is working fine.
- Timezone-related changes are not reflected in a jasperreport image running in an openshift environment HOT 7
- Is there a way to disable encryption of data and remove the need of keys? HOT 3
- Way to import .jrsks and .jrsksp keys without them being overwritten on start up? HOT 3
- Log4jShell HOT 10
- Make version 8.0.0 available HOT 2
- JasperReports as Tomcat default application in URL HOT 7
- jasperserver webapps dir persisting? HOT 3
- README.md Example SMTP settings for gmail don’t work HOT 4
- Image for RPI 4B 64 bit — aarch64 ? HOT 1
- Log4Shell CVE detected via hub.docker.com scan since tag 7.8.1-debian-10-r33 HOT 1
- Log4Shell CVE detected HOT 3
- Log4Shell CVE still detected HOT 3
- JasperReports ignoring SMTP configuration HOT 4
- Postgresql Support HOT 2
- Using an & in database password causes sed expression to fail HOT 3
- docker-compose not working if ALLOW_EMPTY_PASSWORD=NO HOT 3
- Postgres fails to connect HOT 3
- Seeing «mkdir: cannot create directory ‘/bitnami/jasperreports/buildomatic/conf_source/db/postgresql’: Permission denied» when using latest image HOT 4
- Blocked autofocusing on a element in a cross-origin subframe. HOT 3
- bitnami/jasperreports tomcat error after container restart HOT 1
Recommend Projects
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
TensorFlow
An Open Source Machine Learning Framework for Everyone
Django
The Web framework for perfectionists with deadlines.
Laravel
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
server
A server is a program made to process requests and deliver data to clients.
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Visualization
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
Recommend Org
We are working to build community through open source technology. NB: members must have two-factor auth.
Microsoft
Open source projects and samples from Microsoft.
Источник
erro ao executar: Error initializing graphic environment. #23
Exception in thread «main» net.sf.jasperreports.engine.JRRuntimeException: Error initializing graphic environment.
at net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:63)
at net.sf.jasperreports.engine.fill.BaseReportFiller.(BaseReportFiller.java:136)
at net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:273)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:79)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:251)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:272)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:114)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:103)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:530)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:954)
at de.cenote.jasperstarter.Report.fillInternal(Report.java:338)
at de.cenote.jasperstarter.Report.fill(Report.java:282)
at de.cenote.jasperstarter.App.processReport(App.java:226)
at de.cenote.jasperstarter.App.main(App.java:109)
Caused by: java.lang.NullPointerException
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
at sun.font.SunFontManager$2.run(SunFontManager.java:431)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.SunFontManager.(SunFontManager.java:376)
at sun.awt.FcFontManager.(FcFontManager.java:35)
at sun.awt.X11FontManager.(X11FontManager.java:57)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:190)
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:224)
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:252)
at sun.java2d.HeadlessGraphicsEnvironment.getAvailableFontFamilyNames(HeadlessGraphicsEnvironment.java:94)
at net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:58)
. 13 more
The text was updated successfully, but these errors were encountered:
Источник
Error running any report «java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser» about bitnami-docker-jasperreports HOT 17 CLOSED
I’ve found some documentation saying to set parameter «-Djava.awt.headless=true» in order to avoid this problem:
So I modified my .yml file to:
But issue still reproduces. Any ideas?
josepcoves commented on January 15, 2023
I’ve tried to unmap volumes to ensure this isn’t the source of the problem. Now I get an error «Error initializing graphic environment.»
josepcoves commented on January 15, 2023
I finally solved it by installing latest open-jdk-8 in the container by issuing:
apt-get install openjdk-8-jdk
Could you update docker version with latest jdk?
javsalgar commented on January 15, 2023
We would like to reproduce it from our side, but I am no expert in JasperReports. The way to easily create a report is by using JasperSoft Studio? Do you have any report that we could easily import?
josepcoves commented on January 15, 2023
javsalgar commented on January 15, 2023
I did not receive the document, could you put a link to dropbox, drive or any other online platform where I can download it? Thanks
josepcoves commented on January 15, 2023
Hi, I attach the file again
prova_simple.zip
javsalgar commented on January 15, 2023
Just a note to tell you that I was able to reproduce the issue. I think I know what the cause is but I need a bit more checking on my side. I will let you know what I find
josepcoves commented on January 15, 2023
Thanks for your attention!
javsalgar commented on January 15, 2023
It seems the fontconfig library was missing. I’m releasing a new revision of the container
javsalgar commented on January 15, 2023
Just a note to let you know that we released a new revision that includes fontconfig
stale commented on January 15, 2023
This Issue has been automatically marked as «stale» because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
stale commented on January 15, 2023
Due to the lack of activity in the last 5 days since it was marked as «stale», we proceed to close this Issue. Do not hesitate to reopen it later if necessary.
MariumHashmiBM commented on January 15, 2023
I am getting the same error on jasperserver
Adding apt-get install openjdk-8-jdk in dockerfile gives error
E: Unable to locate package openjdk-8-jdk
@javsalgar can you please have a look?
Getting this error
javsalgar commented on January 15, 2023
Which version of the container are you using?
davide-malagoli commented on January 15, 2023
@javsalgar We are getting the same error on jasperserver
We are using one of the latest images, maybe a regression?
javsalgar commented on January 15, 2023
I see that the container is from 4 days ago. Note that 3 days ago we released a new revision that contains fontconfig (we accidentally removed it)
Could you check that it works with the latest image? (remove all jasperreports images from the docker cache)
- Timezone-related changes are not reflected in a jasperreport image running in an openshift environment HOT 7
- Is there a way to disable encryption of data and remove the need of keys? HOT 3
- Way to import .jrsks and .jrsksp keys without them being overwritten on start up? HOT 3
- Log4jShell HOT 10
- Make version 8.0.0 available HOT 2
- JasperReports as Tomcat default application in URL HOT 7
- jasperserver webapps dir persisting? HOT 3
- README.md Example SMTP settings for gmail don’t work HOT 4
- Image for RPI 4B 64 bit — aarch64 ? HOT 1
- Log4Shell CVE detected via hub.docker.com scan since tag 7.8.1-debian-10-r33 HOT 1
- Log4Shell CVE detected HOT 3
- Log4Shell CVE still detected HOT 3
- JasperReports ignoring SMTP configuration HOT 4
- Postgresql Support HOT 2
- Using an & in database password causes sed expression to fail HOT 3
- docker-compose not working if ALLOW_EMPTY_PASSWORD=NO HOT 3
- Postgres fails to connect HOT 3
- Seeing «mkdir: cannot create directory ‘/bitnami/jasperreports/buildomatic/conf_source/db/postgresql’: Permission denied» when using latest image HOT 4
- Blocked autofocusing on a element in a cross-origin subframe. HOT 3
- bitnami/jasperreports tomcat error after container restart HOT 1
Recommend Projects
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
TensorFlow
An Open Source Machine Learning Framework for Everyone
Django
The Web framework for perfectionists with deadlines.
Laravel
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
server
A server is a program made to process requests and deliver data to clients.
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Visualization
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
Recommend Org
We are working to build community through open source technology. NB: members must have two-factor auth.
Microsoft
Open source projects and samples from Microsoft.
Источник
erro na execuçãoException in thread «main» net.sf.jasperreports.engine.JRRuntimeException: Error initializing graphic environment. #183
Ao Executar o arquivo ocorre o erro conforme o print em anexo:
The text was updated successfully, but these errors were encountered:
Exception in thread «main» net.sf.jasperreports.engine.JRRuntimeException: Error initializing graphic environment.
at net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:63)
at net.sf.jasperreports.engine.fill.BaseReportFiller.(BaseReportFiller.java:136)
at net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:273)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:79)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:251)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:272)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:114)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:103)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:530)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:954)
at de.cenote.jasperstarter.Report.fillInternal(Report.java:338)
at de.cenote.jasperstarter.Report.fill(Report.java:282)
at de.cenote.jasperstarter.App.processReport(App.java:226)
at de.cenote.jasperstarter.App.main(App.java:109)
Caused by: java.lang.NullPointerException
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
at sun.font.SunFontManager$2.run(SunFontManager.java:431)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.SunFontManager.(SunFontManager.java:376)
at sun.awt.FcFontManager.(FcFontManager.java:35)
at sun.awt.X11FontManager.(X11FontManager.java:57)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:190)
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:224)
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:252)
at sun.java2d.HeadlessGraphicsEnvironment.getAvailableFontFamilyNames(HeadlessGraphicsEnvironment.java:94)
at net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:58)
. 13 more
Olá @Danillosdd, parece que tem alguma imagem no seu relatório que está dando erro ao gerar.
@Danillosdd você precisa instalar as fontes que usa para os relatórios
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
I have a huge problem. I was coding an app which is using Jasperreports. Everything was perfectly fine when I was working locally. But then, when I have dockerized my app, when I run the method that should produce an PDF file, I get an error:
Request processing failed; nested exception is net.sf.jasperreports.engine.JRRuntimeException: Error initializing graphic environment.
I have found out that running my app with
-DJava.awt.headless=true
the problem would solve itself. But it is not.
This is how it looks like in the Dockerfile
:
ENTRYPOINT [ "java", "-Djava.awt.headless=true", "-jar", "/var/generator/generator-0.0.1-SNAPSHOT.jar" ]
To be sure that I havent forgotten anything, here is the code of the method which is generating the PDF files, maybe there is something wrong there…
The error is coming from this line:
mainReport = JasperFillManager.fillReport(report, invoiceMap, new JREmptyDataSource());
And here is the method:
public byte[] generateInvoicePDF(Invoice invoice) {
/* Map to fill in main JasperReport */
Map<String, Object> invoiceMap = new HashMap<String, Object>();
invoiceMap.put("FIRST_NAME", invoice.getFirstName());
invoiceMap.put("LAST_NAME", invoice.getLastName());
invoiceMap.put("REGON", invoice.getRegon());
invoiceMap.put("NIP", invoice.getNip());
invoiceMap.put("BUSINESS_NAME", invoice.getBusinessName());
invoiceMap.put("BUSINESS_LOCATION", invoice.getBusinessLocation());
invoiceMap.put("ORDER_DATE", invoice.getOrderDate());
invoiceMap.put("RECEPTION_DATE", invoice.getReceptionDate());
invoiceMap.put("CONTRACT_DATE", invoice.getContractDate());
invoiceMap.put("CONTRACTOR_COMMENT", invoice.getContractorComment());
invoiceMap.put("INVOICE_NUMBER", invoice.getInvoiceNumber());
invoiceMap.put("INVOICE_ISSUE_DATE", invoice.getInvoiceIssueDate());
JasperPrint mainReport;
JasperPrint tableReport;
try {
InputStream invoiceJasper = InvoiceGeneratorServiceImpl.class.getResourceAsStream("/invoices/invoice.jrxml");
InputStream taskTableJasper = InvoiceGeneratorServiceImpl.class.getResourceAsStream("/invoices/invoice_sub.jrxml");
JasperDesign mainReportDesign = JRXmlLoader.load(invoiceJasper);
JasperDesign tableReportDesign = JRXmlLoader.load(taskTableJasper);
JasperReport report = JasperCompileManager.compileReport(mainReportDesign);
JasperReport table = JasperCompileManager.compileReport(tableReportDesign);
/* List to hold Items */
List<InvoiceTask> taskList = new ArrayList<>();
/* Add Items to List */
taskList.addAll(invoice.getInvoiceTasks());
/* Convert List to JRBeanCollectionDataSource */
JRBeanCollectionDataSource itemsJRBean = new JRBeanCollectionDataSource(taskList);
/* Map to hold Jasper report Parameters */
Map<String, Object> taskListMap = new HashMap<String, Object>();
taskListMap.put("TasksDataSource", itemsJRBean);
taskListMap.put("ADDITIONAL_COSTS", invoice.getAdditionalCosts());
mainReport = JasperFillManager.fillReport(report, invoiceMap, new JREmptyDataSource());
tableReport = JasperFillManager.fillReport(table, taskListMap, new JREmptyDataSource());
List<JasperPrint> printList = new ArrayList<>();
printList.add(mainReport);
printList.add(tableReport);
JRPdfExporter exporter = new JRPdfExporter();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
exporter.setExporterInput(SimpleExporterInput.getInstance(printList)); //Set as export input my list with JasperPrint s
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(byteArrayOutputStream));
SimplePdfExporterConfiguration configuration = new SimplePdfExporterConfiguration();
configuration.setCreatingBatchModeBookmarks(true); //add this so your bookmarks work, you may set other parameters
exporter.setConfiguration(configuration);
exporter.exportReport();
return byteArrayOutputStream.toByteArray();
} catch (JRException e) {
e.printStackTrace();
}
return new byte[0];
}
And a little bit more of the stack trace:
2019-04-24 08:43:57.338 ERROR 1 --- [io-8080-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is net.sf.jasperreports.engine.JRRuntimeException: Error initializing graphic environment.] with root cause
java.lang.NullPointerException: null
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264) ~[na:1.8.0_201]
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219) ~[na:1.8.0_201]
at sun.awt.FontConfiguration.init(FontConfiguration.java:107) ~[na:1.8.0_201]
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774) ~[na:1.8.0_201]
at sun.font.SunFontManager$2.run(SunFontManager.java:431) ~[na:1.8.0_201]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_201]
at sun.font.SunFontManager.<init>(SunFontManager.java:376) ~[na:1.8.0_201]
at sun.awt.FcFontManager.<init>(FcFontManager.java:35) ~[na:1.8.0_201]
at sun.awt.X11FontManager.<init>(X11FontManager.java:57) ~[na:1.8.0_201]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_201]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_201]
at java.lang.Class.newInstance(Class.java:442) ~[na:1.8.0_201]
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83) ~[na:1.8.0_201]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_201]
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) ~[na:1.8.0_201]
at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:201) ~[na:1.8.0_201]
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:235) ~[na:1.8.0_201]
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:263) ~[na:1.8.0_201]
at sun.java2d.HeadlessGraphicsEnvironment.getAvailableFontFamilyNames(HeadlessGraphicsEnvironment.java:94) ~[na:1.8.0_201]
at net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:58) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.BaseReportFiller.<init>(BaseReportFiller.java:136) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:273) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:79) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:251) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:272) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:156) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:145) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:758) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:1074) ~[jasperreports-6.7.1.jar!/:6.7.1]
at com.generator.service.impl.InvoiceGeneratorServiceImpl.generateInvoicePDF(InvoiceGeneratorServiceImpl.java:68) ~[classes!/:na]
at com.generator.rest.ContractorController.getPdf(ContractorController.java:165) ~[classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
У меня огромная проблема. Я кодировал приложение, использующее Jasperreports. Все было прекрасно, когда я работал локально. Но затем, когда я докеризовал свое приложение, когда я запускаю метод, который должен создать файл PDF, я получаю сообщение об ошибке:
Request processing failed; nested exception is net.sf.jasperreports.engine.JRRuntimeException: Error initializing graphic environment.
Я узнал, что запуск моего приложения с
-DJava.awt.headless=true
Проблема решилась бы сама собой. Но это не так.
Вот как это выглядит в Dockerfile:
ENTRYPOINT [ "java", "-Djava.awt.headless=true", "-jar", "/var/generator/generator-0.0.1-SNAPSHOT.jar" ]
Чтобы быть уверенным, что я ничего не забыл, вот код метода, который генерирует файлы PDF, может быть, там что-то не так…
Ошибка исходит из этой строки:
mainReport = JasperFillManager.fillReport(report, invoiceMap, new JREmptyDataSource());
А вот метод:
public byte[] generateInvoicePDF(Invoice invoice) {
/* Map to fill in main JasperReport */
Map<String, Object> invoiceMap = new HashMap<String, Object>();
invoiceMap.put("FIRST_NAME", invoice.getFirstName());
invoiceMap.put("LAST_NAME", invoice.getLastName());
invoiceMap.put("REGON", invoice.getRegon());
invoiceMap.put("NIP", invoice.getNip());
invoiceMap.put("BUSINESS_NAME", invoice.getBusinessName());
invoiceMap.put("BUSINESS_LOCATION", invoice.getBusinessLocation());
invoiceMap.put("ORDER_DATE", invoice.getOrderDate());
invoiceMap.put("RECEPTION_DATE", invoice.getReceptionDate());
invoiceMap.put("CONTRACT_DATE", invoice.getContractDate());
invoiceMap.put("CONTRACTOR_COMMENT", invoice.getContractorComment());
invoiceMap.put("INVOICE_NUMBER", invoice.getInvoiceNumber());
invoiceMap.put("INVOICE_ISSUE_DATE", invoice.getInvoiceIssueDate());
JasperPrint mainReport;
JasperPrint tableReport;
try {
InputStream invoiceJasper = InvoiceGeneratorServiceImpl.class.getResourceAsStream("/invoices/invoice.jrxml");
InputStream taskTableJasper = InvoiceGeneratorServiceImpl.class.getResourceAsStream("/invoices/invoice_sub.jrxml");
JasperDesign mainReportDesign = JRXmlLoader.load(invoiceJasper);
JasperDesign tableReportDesign = JRXmlLoader.load(taskTableJasper);
JasperReport report = JasperCompileManager.compileReport(mainReportDesign);
JasperReport table = JasperCompileManager.compileReport(tableReportDesign);
/* List to hold Items */
List<InvoiceTask> taskList = new ArrayList<>();
/* Add Items to List */
taskList.addAll(invoice.getInvoiceTasks());
/* Convert List to JRBeanCollectionDataSource */
JRBeanCollectionDataSource itemsJRBean = new JRBeanCollectionDataSource(taskList);
/* Map to hold Jasper report Parameters */
Map<String, Object> taskListMap = new HashMap<String, Object>();
taskListMap.put("TasksDataSource", itemsJRBean);
taskListMap.put("ADDITIONAL_COSTS", invoice.getAdditionalCosts());
mainReport = JasperFillManager.fillReport(report, invoiceMap, new JREmptyDataSource());
tableReport = JasperFillManager.fillReport(table, taskListMap, new JREmptyDataSource());
List<JasperPrint> printList = new ArrayList<>();
printList.add(mainReport);
printList.add(tableReport);
JRPdfExporter exporter = new JRPdfExporter();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
exporter.setExporterInput(SimpleExporterInput.getInstance(printList)); //Set as export input my list with JasperPrint s
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(byteArrayOutputStream));
SimplePdfExporterConfiguration configuration = new SimplePdfExporterConfiguration();
configuration.setCreatingBatchModeBookmarks(true); //add this so your bookmarks work, you may set other parameters
exporter.setConfiguration(configuration);
exporter.exportReport();
return byteArrayOutputStream.toByteArray();
} catch (JRException e) {
e.printStackTrace();
}
return new byte[0];
}
И еще немного трассировки стека:
2019-04-24 08:43:57.338 ERROR 1 --- [io-8080-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is net.sf.jasperreports.engine.JRRuntimeException: Error initializing graphic environment.] with root cause
java.lang.NullPointerException: null
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264) ~[na:1.8.0_201]
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219) ~[na:1.8.0_201]
at sun.awt.FontConfiguration.init(FontConfiguration.java:107) ~[na:1.8.0_201]
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774) ~[na:1.8.0_201]
at sun.font.SunFontManager$2.run(SunFontManager.java:431) ~[na:1.8.0_201]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_201]
at sun.font.SunFontManager.<init>(SunFontManager.java:376) ~[na:1.8.0_201]
at sun.awt.FcFontManager.<init>(FcFontManager.java:35) ~[na:1.8.0_201]
at sun.awt.X11FontManager.<init>(X11FontManager.java:57) ~[na:1.8.0_201]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_201]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_201]
at java.lang.Class.newInstance(Class.java:442) ~[na:1.8.0_201]
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83) ~[na:1.8.0_201]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_201]
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) ~[na:1.8.0_201]
at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:201) ~[na:1.8.0_201]
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:235) ~[na:1.8.0_201]
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:263) ~[na:1.8.0_201]
at sun.java2d.HeadlessGraphicsEnvironment.getAvailableFontFamilyNames(HeadlessGraphicsEnvironment.java:94) ~[na:1.8.0_201]
at net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:58) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.BaseReportFiller.<init>(BaseReportFiller.java:136) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:273) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:79) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:251) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:272) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:156) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:145) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:758) ~[jasperreports-6.7.1.jar!/:6.7.1]
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:1074) ~[jasperreports-6.7.1.jar!/:6.7.1]
at com.generator.service.impl.InvoiceGeneratorServiceImpl.generateInvoicePDF(InvoiceGeneratorServiceImpl.java:68) ~[classes!/:na]
at com.generator.rest.ContractorController.getPdf(ContractorController.java:165) ~[classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
dziki, 24 апреля 2019 г., 11:10
8
4 944
2
- Home
- net.sf.jasperreports
- jasperreports
- 5.5.0
- source code
- JRGraphEnvInitializer.java
Please wait. This can take some minutes …
Project download
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
Information
/*
* JasperReports - Free Java Reporting Library.
* Copyright (C) 2001 - 2013 Jaspersoft Corporation. All rights reserved.
* http://www.jaspersoft.com
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program is part of JasperReports.
*
* JasperReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* JasperReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with JasperReports. If not, see .
*/
package net.sf.jasperreports.engine.util;
import java.awt.GraphicsEnvironment;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import net.sf.jasperreports.engine.JRRuntimeException;
/**
* @author Teodor Danciu ([email protected])
* @version $Id: JRGraphEnvInitializer.java 5878 2013-01-07 20:23:13Z teodord $
*/
public final class JRGraphEnvInitializer
{
/**
*
*/
private static Set AVAILABLE_FONT_FACE_NAMES; //NOPMD
/**
*
*/
public static synchronized void initializeGraphEnv()
{
if (AVAILABLE_FONT_FACE_NAMES == null)
{
AVAILABLE_FONT_FACE_NAMES = new HashSet();
try
{
AVAILABLE_FONT_FACE_NAMES.addAll(
Arrays.asList(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames())
);
}
catch(Exception e)
{
throw new JRRuntimeException("Error initializing graphic environment.", e);
}
}
}
/**
*
*/
public static boolean isAwtFontAvailable(String font)
{
initializeGraphEnv();
return AVAILABLE_FONT_FACE_NAMES.contains(font);//FIXMEFONT not sure if we should check families or fonts
}
private JRGraphEnvInitializer()
{
}
}
Я пытаюсь перенести гибкое приложение с помощью библиотеки отчетов jasper в среду выполнения java 8, и у меня возникает ошибка при загрузке шрифтов для встраивания в отчет PDF. Я думаю , что это связано с безголовым openjdk, но я не могу сказать, так как он находится на Google App Engine.
net.sf.jasperreports.engine.JRRuntimeException: Error initializing graphic environment. (Logger.java:137)
at net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:63)
at net.sf.jasperreports.engine.fill.BaseReportFiller.<init>(BaseReportFiller.java:124)
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:268)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:69)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:219)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:234)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:103)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:456)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:863)
...snip
Caused by: java.lang.NullPointerException
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
at sun.font.SunFontManager$2.run(SunFontManager.java:431)
Возможно связанные Не удается загрузить шрифт в JRE 8
Кто-нибудь испытал это и есть обходной путь? В настоящее время я использую flex, но хотел бы перейти на стандарт, если это возможно.
РЕДАКТИРОВАТЬ: это было исправление, которое заставило его работать
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<!-- These will be managed using maven filters for local execution and proper local datastore namespacing -->
<application>@appId@</application>
<version>@appVersion@</version>
<service>report</service>
<runtime>java8</runtime>
<system-properties>
<property name="sun.awt.fontconfig" value="/base/jre8/lib/fontconfig.Prodimage.properties"/>
</system-properties>
</appengine-web-app>
Спасибо @dsesto!
2 ответа
Лучший ответ
В этом другом сообщении о переполнении стека есть точная та же ошибка, что и та, которой вы делитесь, поэтому вы можете попробовать предложенное там решение.
Вам потребуется добавить системное свойство sun.awt.fontconfig
.
OP обновил свой вопрос редактированием, которое заставило его работать после предложения в этом другом сообщении SO, поэтому вы должны проверить редактирование вопроса для ответа.
2
dsesto
19 Янв 2018 в 19:42
Свойство XML у меня не сработало. Вот что получилось (код Котлина):
fun onStart() {
val libDir = File(System.getProperty("java.home"), "lib")
val fileList = libDir.list()?.toList() ?: listOf()
val fontString = fileList.firstOrNull { it.contains("fontconfig") }
if(fontString != null) {
ErrorLog.logError("Found fontconfig file $fontString")
val fontFile = File(libDir, fontString)
System.setProperty("sun.awt.fontconfig", fontFile.path)
}
}
2
Clyde
27 Янв 2020 в 04:07
posted 17 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
Its a webapp. An error occured during PDF generation on linux machine. Below is the stack trace.
Some other error occured during PDF generation on MAC machine. Below is the stack trace.
Error on MAC is quite simple but dont know what kind of permission it is talking about. My webapp is running on Tomcat5.0.28.
Any inputs would be appreciated.
posted 17 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
hmmmm….
What happens if you execute this code from a standalone program (outside of tomcat). That way you eliminate one possible complication. If the problem still exists outside Tomcat, then you know it’s gotta be something else. Of course, if it works just fine and dandy when you execute it from the command line, then you know its gotta be something in your Tomcat environment.
Try eliminating sources of possible complication and see where it leads you.
— Jess
Adeel Ansari
Ranch Hand
Posts: 2874
posted 17 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
Moreover, I have tried to run the tomcat in headless mode. But that didn’t really work. A new error occured and I am stuck some where in between. Below is the stack trace
Before starting Tomcat I did,. . .
export CATALINA_OPTS=»-Djava.awt.Headless=true»
. . .in order to run JVM in Headless mode.
Any other suggestion please.
author and iconoclast
Posts: 24204
posted 17 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
You can run Xvfb, the X virtual frame buffer, as the tomcat user on display 1 (or any other number besides 0) and then set DISPLAY=:1 in Tomcat’s environment. It’s basically a mini X server, and AWT will be perfectly happy with it. I’ve done this instead of using headless mode. Works great for testing GUI code, too.
Adeel Ansari
Ranch Hand
Posts: 2874
posted 17 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
Its working like charm. Thanks Ernest and Jessica.
It is late due to some security/privileges issues on the linux/MAC Servers.
Thanks a million.
posted 17 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
I’ve tried to run Tomcat in headless mode by modifying the startup.sh script but i’ve got the same Exception and I have no idea of how to: first, install Xvfb and second, set the correct mode to make JR to show my reports. Can anybody give a hand please? The server is a Fedora 3, Java 1.4 y Tomcat 5.0
Thanks in advance
ps. Sorry, I’m a newbie on Linux Servers. :$
Regards,
Omar
SCJP 5, SCWCD 5
posted 17 years ago
-
Number of slices to send:
Optional ‘thank-you’ note:
Originally posted by Omar Palomino Sandoval:
I’ve tried to run Tomcat in headless mode by modifying the startup.sh script but i’ve got the same Exception and I have no idea of how to: first, install Xvfb and second, set the correct mode to make JR to show my reports. Can anybody give a hand please? The server is a Fedora 3, Java 1.4 y Tomcat 5.0Thanks in advance
ps. Sorry, I’m a newbie on Linux Servers. :$
Omar, rather than drudging up this old Swing thread (I don’t really know why it was in the Swing forum to begin with) and then asking an associated Tomcat question, you’d be better off starting a new thread in the Tomcat forum. You’ll have better luck there.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
I got following exception when one of my table in Jasper report grows to next page.
log4j:WARN No appenders could be found for logger (net.sf.jasperreports.engine.fill.BaseReportFiller). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. net.sf.jasperreports.engine.JRRuntimeException: java.lang.StackOverflowError at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:872) at net.sf.jasperreports.components.table.fill.FillTableSubreport.prepareSubreport(FillTableSubreport.java:166) at net.sf.jasperreports.components.table.fill.FillTable.prepare(FillTable.java:417) at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:150) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:330) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:382) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:357) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2031) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:755) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:262) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:122) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:551) at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:411) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:122) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:583) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:929) Caused by: java.lang.StackOverflowError at java.util.HashMap$EntryIterator.<init>(Unknown Source) at java.util.HashMap$EntrySet.iterator(Unknown Source) at java.util.AbstractMap.hashCode(Unknown Source) at java.util.Objects.hashCode(Unknown Source) at java.util.HashMap$Node.hashCode(Unknown Source) ... net.sf.jasperreports.engine.JRException: The report filling thread was interrupted. at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:126) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:583) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:929) ... Caused by: net.sf.jasperreports.engine.fill.JRFillInterruptedException: Report filling process interrupted. at net.sf.jasperreports.engine.fill.BaseReportFiller.checkInterrupted(BaseReportFiller.java:535) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:369) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:357) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillBackground(JRVerticalFiller.java:1819) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:252) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:122) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:551) at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:411) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:122) ... 4 more net.sf.jasperreports.engine.JRRuntimeException: java.lang.StackOverflowError at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:872) at net.sf.jasperreports.components.table.fill.FillTableSubreport.prepareSubreport(FillTableSubreport.java:166) at net.sf.jasperreports.components.table.fill.FillTable.prepare(FillTable.java:417) at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:150) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:330) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:382) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:357) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2031) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:755) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:262) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:122) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:551) at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:411) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:122) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:583) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:929) ... Caused by: java.lang.StackOverflowError at java.util.AbstractMap.hashCode(Unknown Source) at java.util.Objects.hashCode(Unknown Source) at java.util.HashMap$Node.hashCode(Unknown Source) ...
Solution 1
Remove org.apache.log4j jar from your build path and I guess its nearly impossible for you to do so, as you used this log4j everywhere in your code. Solution 2 will save you.
Solution 2
Move your log4j.properties file in src folder. This will work.
Reference
http://community.jaspersoft.com/jasperreports-library/issues/5015#comment-709695