net.sf.jasperreports.engine.JRException: Error loading object from InputStream error after loading report to jasperserver from ireport

6

Hi

I'm facing a strange problem.

I designed a report contains various nested subreports within it. After designing in ireport it is working propely in iReport, when I publish the same report to jasper server its working fine there too.

But when after publishing the report when I'm trying to run it in iReport again its giving error.

 

 

Error filling print... net.sf.jasperreports.engine.JRException: Error loading object from InputStream
Setting up the file resolver... 
Added file resolver... 
net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error loading object from InputStream 
    at net.sf.jasperreports.repo.SerializedObjectPersistenceService.load(SerializedObjectPersistenceService.java:65) 
    at net.sf.jasperreports.repo.SerializedReportPersistenceService.load(SerializedReportPersistenceService.java:46) 
    at net.sf.jasperreports.repo.DefaultRepositoryService.getResource(DefaultRepositoryService.java:187) 
    at net.sf.jasperreports.repo.RepositoryUtil.getResourceFromLocation(RepositoryUtil.java:246) 
    at net.sf.jasperreports.repo.RepositoryUtil.getReport(RepositoryUtil.java:208) 
    at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateReport(JRFillSubreport.java:336) 
    at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:369) 
    at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:294) 
    at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:259) 
    at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:455) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2044) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:778) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:288) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:151) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:909) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:822) 
    at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:651) 
    at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59) 
    at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:203) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
    at java.lang.Thread.run(Thread.java:619) 
Caused by: net.sf.jasperreports.engine.JRException: Error loading object from InputStream 
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:249) 
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:229) 
    at net.sf.jasperreports.repo.SerializedObjectPersistenceService.load(SerializedObjectPersistenceService.java:61) 
    ... 21 more 
Caused by: java.io.StreamCorruptedException: invalid stream header: 3C3F786D 
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783) 
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280) 
    at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.<init>(ContextClassLoaderObjectInputStream.java:58) 
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:244) 
    ... 23 more 

 

I modified the subrepot expression from "repo:subreport.jrxml" to "subreport.jrxml" in iReport but still its giving the same issue. I,m unable to figure it out why its giving this error.The report is same as privious.

Can anyone help me regarding this issue.

 

Thanks

Anand

anand.p's picture
102
Joined: Oct 22 2012 - 1:51am
Last seen: 1 year 1 month ago

Hi I am also having the same problem.If you know the solution please post here.

I am new to Jasper Reports, thanks

 

suren.testmail - 5 years 1 week ago

Hi

I am also facing same problem if you know the solution let me know please

Thanks

 

 

 

sorupalli.csc - 4 years 8 months ago

Hi,

I solve that changing the extension of the file to jasper. Not just modifying the subrepot expression from "repo:subreport.jrxml" to "subreport.jrxml". Because when you upload the report, previously is compiled. So, you need to change to.. "subreport.jasper"

Now, it is working again!

Good luck!

ronal0313 - 3 years 11 months ago
show 1 more...

Yeap chaning jrxml to jasper wiork for SUBREPORT. 

YOu can build project so that SUBreport get compiled

 

vpatel@gwu.edu - 1 year 9 months ago

2 Answers:

0

Change "subreport.jrxml" to "subreport.jasper"

hozawa's picture
39234
Joined: Apr 24 2010 - 4:31pm
Last seen: 1 day 4 hours ago
0

I had the same problem.

But in my case I renamed report.jasper to report.jrxml. Then I recompiled and the .jasper was generated correctly.

Lea R. Ning's picture
Joined: Jul 7 2015 - 11:05am
Last seen: 3 years 8 months ago
Feedback