简体   繁体   English

net.sf.jasperreports.engine.JRException:java.io.IOException:字节数组不是可识别的图像格式

[英]net.sf.jasperreports.engine.JRException: java.io.IOException: The byte array is not a recognized imageformat

net.sf.jasperreports.engine.JRException: java.io.IOException: The byte array is not a recognized imageformat. net.sf.jasperreports.engine.JRException:java.io.IOException:字节数组不是可识别的图像格式。

I am getting this error when I am running the jrxml file that contain images in jasper.当我运行包含 jasper 图像的jrxml文件时出现此错误。 I have changed the version of the itext also in pom.xml file.我也在pom.xml文件中更改了itext的版本。 but its still not working, Can anyone help me with this.但它仍然无法正常工作,任何人都可以帮我解决这个问题。

In my case, I was trying to fetch the image from the classpath , and I was using the same object for creating two diff PDF by changing some values.就我而言,我试图从classpath获取图像,并且我使用相同的对象通过更改一些值来创建两个 diff PDF。 I used FileInputStream to read the image.我使用FileInputStream来读取图像。 This error occurred because we can't reuse InputStream in Java.发生此错误是因为我们无法在 Java 中重用InputStream

This can solve the problem:这可以解决问题:

<dependency>
    <groupId>org.apache.xmlgraphics</groupId>
    <artifactId>batik-all</artifactId>
    <version>1.13</version>
</dependency>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 net.sf.jasperreports.engine.JRException:找不到字节数据 - net.sf.jasperreports.engine.JRException: Byte data not found JasperReport:net.sf.jasperreports.engine.JRException - JasperReport : net.sf.jasperreports.engine.JRException java.lang.ClassNotFoundException: net.sf.jasperreports.engine.JRException - java.lang.ClassNotFoundException: net.sf.jasperreports.engine.JRException Getting.net.sf.jasperreports.engine.JREException:当传递 java.awt.Image 作为参数时,在位置找不到字节数据 - Getting net.sf.jasperreports.engine.JRException: Byte data not found at location when pass java.awt.Image as parameter "net.sf.jasperreports.engine.JRException:无效的页面索引范围:0 - -1 of 0" - net.sf.jasperreports.engine.JRException: Invalid page index range : 0 - -1 of 0 找不到例外档案-net.sf.jasperreports.engine.JRException - exception file not found - net.sf.jasperreports.engine.JRException net.sf.jasperreports.engine.JRException:编译报告java源文件时出错 - net.sf.jasperreports.engine.JRException: Error compiling report java source files JasperReports API。 在报告中使用图像时出现错误:net.sf.jasperreports.engine.JRException:在以下位置找不到字节数据 - JasperReports API. Getting error when using Image in report: net.sf.jasperreports.engine.JRException: Byte data not found at java net.sf.jasperreports.engine.JRRuntimeException:java.io.IOException:系统找不到指定的路径 - java net.sf.jasperreports.engine.JRRuntimeException: java.io.IOException: The system cannot find the path specified JasperReports-net.sf.jasperreports.engine.JRException:从bean检索字段值时出错 - JasperReports - net.sf.jasperreports.engine.JRException: Error retrieving field value from bean
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM