Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319088 - Reading Report Designs not thread-safe when using commons-codec v1.4
Summary: Reading Report Designs not thread-safe when using commons-codec v1.4
Status: VERIFIED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal with 10 votes (vote)
Target Milestone: 4.4.1   Edit
Assignee: Yong Jiang CLA
QA Contact: Morris Kleiman CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-07 04:31 EDT by Alexander Imfeld CLA
Modified: 2014-09-18 15:23 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Imfeld CLA 2010-07-07 04:31:04 EDT
Build Identifier: 2.5.2

Reading report designs involves decoding base64 encoded values (in Base64PropertyState). Base64PropertyState has a static reference to apache commons Base64.

Base64 is no longer thread-safe in v1.4. As a consequence report design reading is not thread-safe when using commons-codec v1.4.

It would be nice to upgrade BIRT to allow for using commons-codec v1.4. I suggest to make the reference to Base64 in Base64PropertyState non-static.

Sample Stacktrace:
Caused by: java.lang.NullPointerException
	at org.apache.commons.codec.binary.Base64.decode(Base64.java:561)
	at org.apache.commons.codec.binary.Base64.decode(Base64.java:741)
	at org.eclipse.birt.report.model.parser.Base64PropertyState.getDecodedBase64Value(Base64PropertyState.java:114)
	at org.eclipse.birt.report.model.parser.Base64PropertyState.end(Base64PropertyState.java:87)
	at org.eclipse.birt.report.model.util.XMLParserHandler.endElement(XMLParserHandler.java:176)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.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.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
	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:314)
	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.getReportDesignHandle(ReportEngineHelper.java:254)
	at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:273)
	at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:183)
	at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:160)
	at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:333)


Reproducible: Always

Steps to Reproduce:
1. use apache commons-codec v1.4
2. have multiple threads simultaneously read report designs
Comment 1 Stanley CLA 2010-07-28 19:18:35 EDT
Inspection of source code indicates the bug was not fixed 2.6.0  (it was reported against 2.5.2)
Comment 2 Zhiqiang Qian CLA 2014-07-23 20:10:34 EDT
This was already fixed.
Comment 3 Morris Kleiman CLA 2014-09-18 15:23:33 EDT
The fix for this issue was to update the version of the jar file for codec V1.4 to v1.6. 

See this path in any current 4.4.1 beta deployment: 

..eclipse\plugins\org.apache.commons.codec_1.6.0.v201305230611.jar