Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to access a report with subreports #332

Open
EbenezerOyenuga opened this issue Jan 12, 2023 · 4 comments
Open

Error when trying to access a report with subreports #332

EbenezerOyenuga opened this issue Jan 12, 2023 · 4 comments

Comments

@EbenezerOyenuga
Copy link

Describe the bug
When I try to access a report with sub-reports I get the error below
0 => "Exception in thread "main" net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error loading object from InputStream."
1 => "\tat net.sf.jasperreports.repo.SerializedObjectPersistenceService.load(SerializedObjectPersistenceService.java:60)"
2 => "\tat net.sf.jasperreports.repo.SerializedReportPersistenceService.load(SerializedReportPersistenceService.java:40)"
3 => "\tat net.sf.jasperreports.repo.DefaultRepositoryService.getResource(DefaultRepositoryService.java:149)"
4 => "\tat net.sf.jasperreports.repo.RepositoryUtil.getResourceFromLocation(RepositoryUtil.java:144)"
5 => "\tat net.sf.jasperreports.repo.RepositoryUtil.getReport(RepositoryUtil.java:112)"
6 => "\tat net.sf.jasperreports.engine.fill.JRFillSubreport.loadReport(JRFillSubreport.java:411)"
7 => "\tat net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateReport(JRFillSubreport.java:378)"
8 => "\tat net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:440)"
9 => "\tat net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:354)"
10 => "\tat net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383)"
11 => "\tat net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:506)"
12 => "\tat net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2412)"
13 => "\tat net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:761)"
14 => "\tat net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:240)"
15 => "\tat net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:99)"
16 => "\tat net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:607)"
17 => "\tat net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:387)"
18 => "\tat net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:109)"
19 => "\tat net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:456)"
20 => "\tat net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:863)"
21 => "\tat de.cenote.jasperstarter.Report.fill(Report.java:253)"
22 => "\tat de.cenote.jasperstarter.App.processReport(App.java:217)"
23 => "\tat de.cenote.jasperstarter.App.main(App.java:102)"
24 => "Caused by: net.sf.jasperreports.engine.JRException: Error loading object from InputStream."
25 => "\tat net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:282)"
26 => "\tat net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:262)"
27 => "\tat net.sf.jasperreports.repo.SerializedObjectPersistenceService.load(SerializedObjectPersistenceService.java:56)"
28 => "\t... 22 more"
29 => "Caused by: java.io.StreamCorruptedException: invalid stream header: 3C3F786D"
30 => "\tat java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:937)"
31 => "\tat java.io.ObjectInputStream.(ObjectInputStream.java:395)"
32 => "\tat net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.(ContextClassLoaderObjectInputStream.java:56)"
33 => "\tat net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:277)"
34 => "\t... 24 more"

To Reproduce
Steps to reproduce the behavior:

  1. Composer require phpjasper on laravel
  2. create a report with subreports on jasper studio
  3. try accessing the report using the documentation giving
  4. ensure you change the code in the output function to "return $this->the_command" in /vendor/cossou/jasperphp/src/JasperPHP/JasperPHP.php
  5. See error

Expected behavior
It was expected to create the pdf report as it was working perfectly in Jasper Studio but it did not. So I decided to output the error and that was when I got the error above

Screenshot
Screenshot from 2023-01-12 10-25-09

@ChimenesLuiz
Copy link

I'm having the same problem, someone can help us?

@SanjoyDU
Copy link

SanjoyDU commented May 8, 2024

Same issue happening please help

Describe the bug
When I try to access a report with sub-reports I get the error below
0 => "Exception in thread "main" net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error loading object from InputStream."
1 => "\tat net.sf.jasperreports.repo.SerializedObjectPersistenceService.load(SerializedObjectPersistenceService.java:60)"
2 => "\tat net.sf.jasperreports.repo.SerializedReportPersistenceService.load(SerializedReportPersistenceService.java:40)"
3 => "\tat net.sf.jasperreports.repo.DefaultRepositoryService.getResource(DefaultRepositoryService.java:149)"
4 => "\tat net.sf.jasperreports.repo.RepositoryUtil.getResourceFromLocation(RepositoryUtil.java:144)"
5 => "\tat net.sf.jasperreports.repo.RepositoryUtil.getReport(RepositoryUtil.java:112)"
6 => "\tat net.sf.jasperreports.engine.fill.JRFillSubreport.loadReport(JRFillSubreport.java:411)"
7 => "\tat net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateReport(JRFillSubreport.java:378)"
8 => "\tat net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:440)"
9 => "\tat net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:354)"
10 => "\tat net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383)"
11 => "\tat net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:506)"
12 => "\tat net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2412)"
13 => "\tat net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:761)"
14 => "\tat net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:240)"
15 => "\tat net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:99)"
16 => "\tat net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:607)"
17 => "\tat net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:387)"
18 => "\tat net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:109)"
19 => "\tat net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:456)"
20 => "\tat net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:863)"
21 => "\tat de.cenote.jasperstarter.Report.fill(Report.java:253)"
22 => "\tat de.cenote.jasperstarter.App.processReport(App.java:217)"
23 => "\tat de.cenote.jasperstarter.App.main(App.java:102)"
24 => "Caused by: net.sf.jasperreports.engine.JRException: Error loading object from InputStream."
25 => "\tat net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:282)"
26 => "\tat net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:262)"
27 => "\tat net.sf.jasperreports.repo.SerializedObjectPersistenceService.load(SerializedObjectPersistenceService.java:56)"
28 => "\t... 22 more"
29 => "Caused by: java.io.StreamCorruptedException: invalid stream header: 3C3F786D"
30 => "\tat java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:937)"
31 => "\tat java.io.ObjectInputStream.(ObjectInputStream.java:395)"
32 => "\tat net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.(ContextClassLoaderObjectInputStream.java:56)"
33 => "\tat net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:277)"
34 => "\t... 24 more"

@ChimenesLuiz
Copy link

Works for me use the same compiller for all .jrxml reports/sub_reports.
Example:
sh vendor/geekcom/phpjasper/bin/jasperstarter/bin/jasperstarter compile /var/www/html/reports/child_subreport_1.jrxml
And after do the same with de "dad" report
sh vendor/geekcom/phpjasper/bin/jasperstarter/bin/jasperstarter compile /var/www/html/reports/dad_report.jrxml

@LimaJonas
Copy link

Same error here. I had to modify a subreport with JasperSoft, and it must have changed the version without me noticing. So I ran the compile command on the JRXML, and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants