English 中文(简体)
BIRT 2.5 deployed with Xerces jar in WEB-INF/lib throws NullPointerException
原标题:

so I am having pretty much exactly the same problem as what someone else has described here: birt-exchange.

I have integrated BIRT with my existing web application that requires the xerces jar (mine is version 2.5) and the following exception is thrown when I attempt to view the report:

java.lang.NullPointerException
    at org.eclipse.birt.chart.reportitem.ChartReportItemImpl.doCompatibility(ChartReportItemImpl.java:302)
    at org.eclipse.birt.chart.reportitem.ChartReportItemImpl.deserialize(ChartReportItemImpl.java:282)
    at org.eclipse.birt.report.model.extension.PeerExtensibilityProvider.initializeReportItem(PeerExtensibilityProvider.java:582)
    at org.eclipse.birt.report.model.elements.ExtendedItem.initializeReportItem(ExtendedItem.java:305)
    at org.eclipse.birt.report.model.elements.ExtendedItem.doCheck(ExtendedItem.java:642)
    at org.eclipse.birt.report.model.elements.ExtendedItem.checkCompatibility(ExtendedItem.java:604)
    at org.eclipse.birt.report.model.parser.ModuleParserHandler.handleExtendedItemCompatibility(ModuleParserHandler.java:431)
    at org.eclipse.birt.report.model.parser.ModuleParserHandler.endDocument(ModuleParserHandler.java:393)
    at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
    at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
    at org.eclipse.birt.report.model.parser.ModuleReader.readModule(ModuleReader.java:94)
    at org.eclipse.birt.report.model.parser.DesignReader.read(DesignReader.java:88)
    at org.eclipse.birt.report.model.core.DesignSessionImpl.openDesign(DesignSessionImpl.java:315)
    at org.eclipse.birt.report.model.api.SessionHandleImpl.openDesign(SessionHandleImpl.java:294)
    at org.eclipse.birt.report.engine.parser.ReportParser.getDesignHandle(ReportParser.java:158)
    at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:255)
    at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:589)
    at org.eclipse.birt.report.service.ReportEngineService.openReportDesign(ReportEngineService.java:383)
    at org.eclipse.birt.report.utility.BirtUtility.getRunnableFromDesignFile(BirtUtility.java:594)
    at org.eclipse.birt.report.context.ViewerAttributeBean.getDesignHandle(ViewerAttributeBean.java:654)
    at org.eclipse.birt.report.context.ViewerAttributeBean.__init(ViewerAttributeBean.java:231)
    at org.eclipse.birt.report.context.BaseAttributeBean.init(BaseAttributeBean.java:233)
    at org.eclipse.birt.report.context.ViewerAttributeBean.<init>(ViewerAttributeBean.java:116)
    at org.eclipse.birt.report.context.BirtContext.__init(BirtContext.java:44)
    at org.eclipse.birt.report.context.BaseContext.<init>(BaseContext.java:69)
    at org.eclipse.birt.report.context.BirtContext.<init>(BirtContext.java:30)
    at org.eclipse.birt.report.servlet.ViewerServlet.__getContext(ViewerServlet.java:150)
    at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:243)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)

I have successfully viewed the integrated demo report (included with the BIRT runtime download) with my existing application, but it did not include a chart, my report does. The stack trace indicates the chart is the difference between not working and working.

Does anyone have any ideas? I cannot remove the xerces jar since my existing app will fail to deploy. Is there anyway of effectively telling BIRT to ignore whatever other jars might be contained in the WEB-INF/lib directory?

In case it s relevant; my web app server is Tomcat 5.5.

最佳回答

I belive I have found the problem.

Under the directory WEB-INF/platform/plugins (where platforms is a BIRT specific directory) there is a jar named org.apache.xerces_2.9.0.v200909240008.jar.

I update my Xerces jar to version 2.9 and seems to be working...hope that helps anyone who may also hit this problem!

问题回答

Got the same problem, in my case it turned out to a be an older version of Xerces on the classpath (2.4). Removing that one solved the problem.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签