`
bean-woo
  • 浏览: 135444 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser

阅读更多

 

  1. java.lang.NoClassDefFoundError: Could not initialize classnet.sf.jasperreports.engine.util.JRStyledTextParser  
  2.     net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:174)  
  3.     net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:74)  
  4.     net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:56)  
  5.     net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:143)  
  6.     net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:115)  
  7.     net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:435)  
  8.     net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:271)  
  9.     saude.apresentacao.GeraRelatorioComponent.gerar(GeraRelatorioComponent.java:44)  
  10.     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  11.     sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
  12.     sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
  13.     java.lang.reflect.Method.invoke(Unknown Source)  
  14.     org.vraptor.component.DefaultLogicMethod.execute(DefaultLogicMethod.java:61)  
  15.     org.vraptor.interceptor.ExecuteLogicInterceptor.intercept(ExecuteLogicInterceptor.java:32)  
  16.     org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)  
  17.     org.vraptor.interceptor.SettingAndValidationInterceptor.intercept(SettingAndValidationInterceptor.java:130)  
  18.     org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)  
  19.     org.vraptor.interceptor.InjectionInterceptor.intercept(InjectionInterceptor.java:41)  
  20.     org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)  
  21.     org.vraptor.interceptor.ComponentLookupInterceptor.intercept(ComponentLookupInterceptor.java:57)  
  22.     org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)  
  23.     org.vraptor.interceptor.FlashScopeInterceptor.intercept(FlashScopeInterceptor.java:22)  
  24.     org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)  
  25.     org.vraptor.interceptor.RegisterAttributesInteceptor.intercept(RegisterAttributesInteceptor.java:47)  
  26.     org.vraptor.core.InterceptorsLogicFlow.execute(InterceptorsLogicFlow.java:72)  
是因为.jar包不正确(版本不匹配或者是差.jar包)
下面这份是正确的。我测试过的,用的是(jasperReport4.0.2)

 

分享到:
评论
3 楼 dingding317 2013-10-30  
这个问题也困扰了我很久,终于解决了!

在tomcat启动脚本中加上-Djava.awt.headless=true,(注意空格)

具体步骤如下:
修改${TOMCAT_HOME}/bin/catalina.sh或${TOMCAT_HOME}/bin/catalina.bat文件:

在所有类似以下代码:
    "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
      -Djava.security.manager \
      -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
      -Dcatalina.base="$CATALINA_BASE" \
      -Dcatalina.home="$CATALINA_HOME" \
      -Djava.io.tmpdir="$CATALINA_TMPDIR" \



在尾部加上一句:
      -Djava.awt.headless=true \



修改后内容如下:
    exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
      -Dcatalina.base="$CATALINA_BASE" \
      -Dcatalina.home="$CATALINA_HOME" \
      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
      -Djava.awt.headless=true \



以tomcat6.0为例,总共有七处这样的地方。
然后重启tomcat服务器。
噢了!
2 楼 bean-woo 2011-11-17  
具体的没试过。我想也可能是缺什么包吧。开始我在XP下跑没问题,部署到windows server 2008也出问题
1 楼 tao3618341 2011-11-16  
你好,我现在开发是也碰到一个类似于你这个问题。但是我在Windows是没有问题的。在linux部署时,就出现错误。
java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
	net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:182)
	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.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:324)
	org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
	com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:362)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266)
	com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
	com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
	org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
	com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
	com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
	com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
	com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
	org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
	org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
	org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
	org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	cn.com.timekey.drugmonitor.security.MyFilterSecurityInterceptor.invoke(MyFilterSecurityInterceptor.java:81)
	cn.com.timekey.drugmonitor.security.MyFilterSecurityInterceptor.doFilter(MyFilterSecurityInterceptor.java:43)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
	org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

相关推荐

    ezmorph-1.0.6.jar

    缺少这个包可能导致Could not initialize class net.sf.json.JsonConfig 使用json时候将会用到的一个jar包,发现这个包在网上提供的比较少.缺少这个包可能导致Could not initialize class net.sf.json.JsonConfig ...

    jasperreport maven打包后找不到字体解决方案

    jasperreport 用maven打包后找不到字体解决方案 net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font

    jasperreports所有的jar包

    标题中的"jasperreports所有的jar包"指的是JasperReports库的相关组件集合,这是一个用于创建复杂的报表的开源Java库。JasperReports支持多种数据源,包括数据库连接、CSV、XML等,能够生成PDF、HTML、Excel等多种...

    java串口所需依赖dll文件合集

    监听COM口启动程序报错 Could not initialize class gnu.io.RXTXCommDriver异常 是因为需要在%JAVA_HOME%/jre/bin目录中添加rxtxParallel.dll、rxtxSerial.dll文件

    解决hbase client在windows环境下报NoClassDefFound问题

    解决hbase client在windows环境下报Could not initialize class org.fusesource.jansi.internal.Kernel32的问题,把jar包放入hbase client的lib包下,重新运行hbase.cmd shell即可

    json-lib-2.1 2.2 2.3 2.4-jdk15

    JSONArray.fromObject(map)报错:Could not initialize class net.sf.json.JsonConfig。ireport 需要高于2.1版本的包。于是就找了这些包。最后2.2.2适合

    jacob_1.14.3.rar

    内涵jacob_1.14.3-x64.dll;jacob_1.14.3-64.jdk(maven地址);解决方法:Could not initialize class com.jacob.com.ComThread

    linux上实现视频截图

    public class VideoScreenshot { public static void main(String[] args) { String videoFilePath = "/path/to/your/video"; String screenshotPath = "/path/to/screenshot.png"; // 打开视频文件 avformat....

    derby.jar 。。

    java.lang.NoClassDefFoundError: Could not initialize class org.apache.derby.jdbc.AutoloadedDriver40 导致的原因: 在azkaban的server和executor中缺少一个叫derby.jar的包

    gnu.io.rar_android_gnu.io _librxtxSerial_librxtxSerial._librxtxS

    在Android平台上进行串口通信开发时,常常会遇到需要与硬件设备进行低级别交互的情况,例如读写传感器数据、控制外部设备等。标题中的“gnu.io.rar_android_gnu.io _librxtxSerial_librxtxSerial._librxtxS”提到了`...

    Plsql 12连接Oracle时出现Could not initialize oci.dll解决方案 oracle 客户端

    在使用PL/SQL Developer 12连接Oracle数据库时,可能会遇到“Could not initialize oci.dll”这样的错误提示。这个错误通常表明系统无法找到或正确加载Oracle客户端的oci.dll库文件,这是Oracle Instant Client的一...

    gnu.io.SerialPort( rxtx-2.1.7.jar)

    gnu.io.CommDriver.class gnu.io.CommPort.class gnu.io.CommPortEnumerator.class gnu.io.CommPortIdentifier.class gnu.io.CommPortOwnershipListener.class gnu.io.Configure.class gnu.io.I2C.class gnu.io.I2...

    Hadoop1.0部署的各种坑及解决之道

    NULL 博文链接:https://ajaxcn.iteye.com/blog/2288977

    Maven常见问题解答

    3. **Maven构建提示`Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer`**:这个问题通常意味着`maven-war-plugin`插件的版本太低,无法与当前Maven环境兼容。解决方法是在`...

    tess4j-so(×32、×64)

    Tesseract OCR API的Java JNA包装器 Tess4J API 提供的功能: 1、直接识别支持的文件 2、识别图片流 3、识别图片的某块区域 4、将识别结果保存为 TEXT/ HOCR/ PDF/ UNLV/ BOX 5、通过设置取词的等级,提取识别出来...

    eclipse Activiti 插件 jar包 出错

    org.activiti.designer.kickstart.util org.activiti.designer.libs org.activiti.designer.util org.activiti.designer.validation.bpmn org.eclipse.graphiti.mm org.eclipse.graphiti.pattern org.eclipse....

    Plsql Developer连接Oracle时出现Could not initialize oci.dll解决方案

    在使用PL/SQL Developer这款强大的Oracle数据库管理工具时,有时可能会遇到“Could not initialize oci.dll”的错误提示,这通常是由于应用程序与Oracle客户端组件之间的兼容性问题导致的。本文将详细介绍如何解决这...

    Tesseract-OCR java版

    **Tesseract OCR Java版**是将开源的Tesseract光学字符识别(OCR)引擎与Java环境相结合,用于在图像中识别和提取文字。Tesseract最初由HP开发,后来由Google维护,它具有高度的准确性和可扩展性,尤其适用于处理...

    derby_ui_plugin_1.1.1

    Derby UI Plugin 1.1.1 是一个专门为Java开发者设计的用户界面插件,它在Java学习过程中能提供极大的便利。这个插件版本号为1.1.1,暗示了它可能包含了一些修复和改进,以提升用户体验和兼容性。...

Global site tag (gtag.js) - Google Analytics