`
Jellen129
  • 浏览: 61944 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
社区版块
存档分类
最新评论

错误 500 java.lang.NoClassDefFoundError: com/lowagie/text/pdf/FontMapper

    博客分类:
  • JAVA
阅读更多

在制作报表过程中,以pdf格式打印时出现的错误:

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: 
java.lang.NoClassDefFoundError: com/lowagie/text/pdf/FontMapper




	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

root cause

javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/lowagie/text/pdf/FontMapper
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:852)
	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
	org.apache.jsp.html.page.report.report_jsp._jspService(report_jsp.java:126)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

出现此问题的原因:

原来是我导的包有问题,如下:

jasperreports-3.5.3.jar   ---> iText-2.1.0.jar  才是正确的


iText-2.1.0.jar ---> com.lowagie

 

iText-5.0.6.jar ---> com.itextpdf.text 

 

所以在用 jasperreports-3.5.3.jar时,不能用 iText-5.0.6.jar

 

 

 

 

 

 

 

分享到:
评论
1 楼 yuanandyy 2012-10-15  
谢谢,帮了大忙啊

相关推荐

Global site tag (gtag.js) - Google Analytics