DJ메탈짱™의 Free Style

[JasperReports] Font 'IDAutomationHC39M' is not available to the JVM 오류발생 본문

일(job)/JAVA

[JasperReports] Font 'IDAutomationHC39M' is not available to the JVM 오류발생

뽀&쏭 2016. 1. 22. 17:10

 

 

JasperReports 실행 시 아래와 같은 오류 발생.

내용을 확인해본 결과 리포팅 툴(iReport)에서 사용되는 font가 존재하지 않는 경우 컴파일 오류가 발생하는 것으로 판단됨.

 

###########################################################################

JasperReports encountered this error : 

net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'IDAutomationHC39M' is not available to the JVM. See the Javadoc for more details.

at net.sf.jasperreports.engine.fonts.FontUtil.checkAwtFont(FontUtil.java:344)

at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.loadFont(SimpleTextLineWrapper.java:369)

at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.getGeneralFontInfo(SimpleTextLineWrapper.java:339)

at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.createFontInfo(SimpleTextLineWrapper.java:279)

at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.start(SimpleTextLineWrapper.java:241)

at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:411)

at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:621)

at net.sf.jasperreports.engine.fill.JRFillTextField.prepare(JRFillTextField.java:695)

at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:331)

at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:384)

at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:358)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:346)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:280)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:151)

at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:932)

at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845)

at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:61)

at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:849)

at kr.co.sys4u.bos.report.JasperPrintServlet.service(JasperPrintServlet.java:144)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at kr.co.sys4u.bos.etc.EncodingFilter.doFilter(EncodingFilter.java:50)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.a...................................

###########################################################################

 

역시 구글 검색에 의해 해결 방안?을 찾았다는...

1.해당 프로젝트의 lib 폴더에 있는 jasperreports-x.x.x.jar 파일을 찾아서 압축을 해제함.

2.압축해제 시 존재하는 default.jasperreports.properties 파일을 열어본다.

3.net.sf.jasperreports.awt.ignore.missing.font 항목을 찾아서 false --> true로 수정한다.

4.해당 jar파일을 다시 생성하여 기존 jar로 덮어 씌우면...

5.위와 같이 Font? 관련 오류는 발생하지 않고 report 결과를 정상적으로 확인할 수 있음.

 

해결 방안에 대한 전문은 아래와 같습니다.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

The easy steps to solve this problem would be

1. Open jasperreports-x.x.x.jar, in my case jasperreports-3.7.2.jar.

2. Locate default.jasperreports.properties file and open it.

3. Find the line net.sf.jasperreports.awt.ignore.missing.font=false and change value from false to true net.sf.jasperreports.awt.ignore.missing.font=true.

4. Update the jar.

5. Add to classpath of your project.

 

The problem is solved.


출처 : http://stackoverflow.com/questions/3987804/jasper-stops-finding-one-font

[첨부파일] "이지넷소프트"에서 작성한 JasperReports 개발자 매뉴얼