Jasper Reports + WebSphere 7,ExceptionInInitializerError异常 [英] Jasper Reports + WebSphere 7, ExceptionInInitializerError exception

查看:118
本文介绍了Jasper Reports + WebSphere 7,ExceptionInInitializerError异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

调用JasperFillManager.fillReport()时,我们得到以下异常。令人困惑的是,它发生在我们的生产环境中,但在我们的测试环境中工作正常。

We're getting the below exception when calling JasperFillManager.fillReport(). The confusing aspect is that it happens in our "production" environment, but works fine in our TEST environment.

显然这个问题发生在静态属性的初始化过程中,我们认为它可能与多线程Jasper有关(ThreadLocal-stuff)。

Apparently this issue happens during initialization of a static property, and we think it may be related to the multi-threading Jasper does (ThreadLocal-stuff).

我们尝试了java.awt.headless = true J​​VM设置作为一些建议已经表示,但没有变化。我们真的需要有关故障排除的建议,或者在一个环境中可能导致这种情况的线索,而不是另一个环境中的原因。据我们所知,它们是相同的,但显然某些东西是不同的,我们没有想要检查的东西。
所以问题确实是......
我们如何解决这样的问题呢?

We've tried the java.awt.headless=true JVM setting as some suggestions have indicated, but there was no change. We're really in need of suggestions for troubleshooting, or clues as to what might cause this in one environment but not the other. As far as we can tell, they're the same, but obviously something is different and we're out of ideas for things to check. So the question really is... how can we troubleshoot an issue like this?

Jasper Reports 4.7 (也出现在3.7)

Jasper Reports 4.7 (Also occurs with 3.7)

Java 1.6,Flex(服务器上的GraniteDS)/ Spring / Hibernate

(我们没有使用EJB,我们通过简单的war文件部署)

Java 1.6, Flex (GraniteDS on server)/Spring/Hibernate
(we're not using EJB, and we deploy via a simple war file)

FunctionName: com.ibm.ws.webcontainer.servlet.ServletWrapper.service
SourceId: com.ibm.ws.webcontainer.servlet
Category: SEVERE
ExtendedMessage: SRVE0068E: Uncaught exception created in one of the service methods of the servlet ReportServlet in application B
AO. Exception created : java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:121)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:88)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:103)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:61)
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:153)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:55)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:407)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:824)
at gov.bao.util.JasperWork.execute(JasperWork.java:36)
at org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1997)
at gov.bao.dao.ReportDao.generateJasperReport(ReportDao.java:246)
at gov.bao.service.ReportService.getTracerReport(ReportService.java:258)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy65.getTracerReport(Unknown Source)
at gov.bao.servlet.ReportServlet.doGet(ReportServlet.java:110)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:359)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:275)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:344)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:272)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:81)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ib***BUFFER OVERFLOW***Y
Trace: 2012/09/06 08:43:55.556 01 t=8C9CF0 c=UNK key=P8 (00000011)
Description: Log Java Message
Message: SRVE0068E: Uncaught exception created in one of the service methods of the servlet ReportServlet in application BAO. Exce
ption created : java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:121)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:88)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:103)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:61)
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:153)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:55)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:407)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:824)
at gov.bao.util.JasperWork.execute(JasperWork.java:36)
at org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1997)
at gov.bao.dao.ReportDao.generateJasperReport(ReportDao.java:246)
at gov.bao.service.ReportService.getTracerReport(ReportService.java:258)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy65.getTracerReport(Unknown Source)
at gov.bao.servlet.ReportServlet.doGet(ReportServlet.java:110)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:359)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:275)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:344)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:272)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:81)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ib***BUFFER OVERFLOW***Y com.ibm.ws.webcontainer.servlet.ServletWrapper.service


推荐答案

要解决问题,您需要获取由此引发的原始异常静态初始化器。通常,该异常链接到ExceptionInInitializerError,这是第一次尝试加载包含静态初始值设定项的类。

To troubleshoot the issue, you need to get the original exception thrown by the static initializer. Normally that exception is linked to the ExceptionInInitializerError, the first time an attempt is made to load the class that contains the static initializer.

因此,您需要做两件事:

Therefore you need to do two things:


  1. 确保您能够获得整个堆栈跟踪。您发布的堆栈跟踪似乎被截断(请参阅 *** BUFFER OVERFLOW *** 标记)。

  2. 获取在第一次初始化类的尝试时抛出异常的堆栈跟踪。如有必要,请重新启动应用程序或服务器。

  1. Ensure that you are able to get the entire stack trace. The stack trace you have posted seems to be truncated (see the ***BUFFER OVERFLOW*** marker).
  2. Get the stack trace of the exception thrown when the first attempt to initialize the class is made. If necessary, restart the application or server.

这篇关于Jasper Reports + WebSphere 7,ExceptionInInitializerError异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆