net.sf.jasperreports.engine.JRException: Byte data not found at:

0

I have a parameterized report that fills an image block with either an image soourced from another site, or onestored inthe database.  When I use the database, the report works fine.  When I try to use the site-based image, I get the followig error.  Here is what i think are the pertinent jrxml snippets:

 
...
<parameter name="imageSource" class="java.lang.String">  <defaultValueExpression><![CDATA["snapshot"]]></defaultValueExpression> </parameter>
...
<reportElement positionType="Float" x="826" y="32" width="780" height="793" uuid="f20892dc-6ac6-4c88-abba-73356dd0857f">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<imageExpression><![CDATA[($P{imageSource}.equals("live") ? $P{imageUrlHourly}+$F{StockTicker} : $F{HourlyImageSnapshot})]]></imageExpression>
<hyperlinkReferenceExpression><![CDATA[$P{AddToFavListUrlBase} + $F{StockTicker} + $P{AddToFavListUrlMiddle} + $F{ScListNum} + "&name=" + $F{StockTicker} + "-" + $F{Close} + "-" + $F{ScanName}]]></hyperlinkReferenceExpression>
</image>
...

 

I pass in imageSource="live".

I'm not sure why the byte data is even being considered?

 

net.sf.jasperreports.engine.JRException: Byte data not found at: AEO.
2015-11-04 23:06:21,225 [main] INFO  (ScanResultSummaryWithDetailsReport.java:56) - creating report - C:/DEV/ss4/AutoStockScans/temp/ScanResultSummaryWithDetails_snapshot_test.html
at net.sf.jasperreports.repo.RepositoryUtil.getBytesFromLocation(RepositoryUtil.java:210)
at net.sf.jasperreports.engine.RenderableUtil.getRenderable(RenderableUtil.java:122)
at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:584)
at net.sf.jasperreports.engine.fill.JRFillImage.evaluate(JRFillImage.java:520)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:281)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:504)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2029)
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:555)
at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:396)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:91)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:456)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:863)
at net.hb.ss4.report.ScanResultSummaryWithDetailsReport.createScanResultSummaryWithDetailsSnapshotReport(ScanResultSummaryWithDetailsReport.java:64)
at net.hb.ss4.report.ScanResultSummaryWithDetailsReport.createScanResultSummaryWithDetailsLiveReport(ScanResultSummaryWithDetailsReport.java:40)
at net.hb.ss4.test.reports.JasperReportsUtilTest.ScanResultsDetailsByScanResultSummaryReport(JasperReportsUtilTest.java:61)
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:483)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

 

 

swvajanyatek's picture
Joined: May 4 2011 - 3:03pm
Last seen: 3 years 11 months ago

2 Answers:

1

Check if you can access the image from you web browser. If you can, check the parameter value in your report to make sure it's the right url.

hozawa's picture
51078
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 months 1 week ago
2
Error 500: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is net.sf.jasperreports.engine.JRException: Byte data not found at : ..//reports//images//xyz.gif
 
The above error is fixed by using the imageExpression
 
getClass().getResource("META-INF/resources/......../themes/default/images/xyz.png").openStream()
satishmhiremath's picture
Joined: Sep 29 2016 - 7:06am
Last seen: 2 years 4 weeks ago
Feedback
randomness