贾斯珀:Arial' JVM无法使用

时间:2015-01-27 15:17:25

标签: java linux java-ee jasper-reports report

我在Linux机器上遇到这个错误我希望将字体名称设置为“SansSerif”,它安装在Linux机器上,但不知道为什么总是得到“字体'Arial'不能用于JVM。”。< / p>

在代码中我设置了“SansSerif”

JRProperties.setProperty("net.sf.jasperreports.awt.ignore.missing.font", "true");
JRProperties.setProperty("net.sf.jasperreports.default.font.name", "SansSerif");

Limitaions

  • 我无法在linux上安装字体。
  • 我无法在代码中放置任何字体jar。

我需要通过JAVA代码解决任何问题。

栈跟踪

pring: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Arial' is not available to the JVM. See the Javadoc for more details.
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:932)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1227)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)
        at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1032)
        at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
        at com.ibm.ws.webcont

StackTrace 2 : 在net.sf.jasperreports.awt.ignore.missing.font=true中实施jasperreports.properties后,我收到此错误。

[27/01/15 14:55:08:779 GMT] 000000b7 webapp        E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[spring]: net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Arial' is not available to the JVM. See the Javadoc for more details.
 at net.sf.jasperreports.engine.util.JRFontUtil.checkAwtFont(JRFontUtil.java:358)
 at net.sf.jasperreports.engine.util.JRStyledText.getAwtAttributedString(JRStyledText.java:225)
 at net.sf.jasperreports.engine.export.AbstractTextRenderer.render(AbstractTextRenderer.java:264)
 at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:2075)
 at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:778)
 at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:738)
 at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:616)
 at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:364)
 at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(JasperExportManager.java:163)

0 个答案:

没有答案