gpt4 book ai didi

java - net.sf.jasperreports.engine.JRRuntimeException : java. io.IOException: 无法读取字体数据

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:51:37 24 4
gpt4 key购买 nike

我正在尝试通过 JasperReport 创建 PDF 报告,但读取字体数据时出现问题。我在 ClassPath 中有 jasperreports_extension.properties 和相关的 TTF 文件。这是错误:

java.io.IOException: Problem reading font data.
java.awt.Font.createFont(Font.java:924)
net.sf.jasperreports.engine.fonts.SimpleFontFace.<init>(SimpleFontFace.java:69)
net.sf.jasperreports.engine.fonts.SimpleFontFamily.createFontFace(SimpleFontFamily.java:316)
net.sf.jasperreports.engine.fonts.SimpleFontFamily.setNormal(SimpleFontFamily.java:85)
net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFamily(SimpleFontExtensionHelper.java:243)
net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFamilies(SimpleFontExtensionHelper.java:214)
net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:183)
net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:152)
net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.getExtensions(FontExtensionsRegistry.java:55)
net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:110)
net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextParser.java:83)
net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:121)
net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:77)
net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:87)
net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:142)
net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:78)
net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624)
org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView.fillReport(AbstractJasperReportsView.java:666)
org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView.renderMergedOutputModel(AbstractJasperReportsView.java:559)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1063)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:801)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

谁能帮帮我??

谢谢!

最佳答案

更改 tomcat 临时目录的权限以允许 tomcat/jasper 写入它。

参见:http://community.jaspersoft.com/questions/543492/javaioioexception-problem-reading-font-data

关于java - net.sf.jasperreports.engine.JRRuntimeException : java. io.IOException: 无法读取字体数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17855830/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com