Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368859 - NullPointerException when creating PDF for HTML table with unexpected background-image
Summary: NullPointerException when creating PDF for HTML table with unexpected backgro...
Status: RESOLVED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.6.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.2.0   Edit
Assignee: Birt-ReportEngine-inbox@eclipse.org CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-17 13:02 EST by Sean Adkinson CLA
Modified: 2012-04-13 05:02 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Adkinson CLA 2012-01-17 13:02:51 EST
Build Identifier: BIRT Report Engine 2.6.2

Creating a PDF report from HTML can fail with a NPE with the following HTML:

********************************************
<table style="background-image: none;">
	<tbody>
		<tr>
			<td>
				Test</td>
		</tr>
	</tbody>
</table>
*********************************************

The resulting stacktrace:
*********************************************
java.lang.NullPointerException
	at org.eclipse.birt.report.engine.nLayout.area.style.BackgroundImageInfo.<init>(BackgroundImageInfo.java:70)
	at org.eclipse.birt.report.engine.nLayout.area.impl.TableArea.buildProperties(TableArea.java:147)
	at org.eclipse.birt.report.engine.nLayout.area.impl.TableArea.initialize(TableArea.java:186)
	at org.eclipse.birt.report.engine.nLayout.LayoutEngine.setContainer(LayoutEngine.java:352)
	at org.eclipse.birt.report.engine.nLayout.LayoutEngine._startContainer(LayoutEngine.java:404)
	at org.eclipse.birt.report.engine.nLayout.LayoutEngine.startContainer(LayoutEngine.java:340)
	at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startTable(ContentEmitterAdapter.java:75)
	at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:50)
	at org.eclipse.birt.report.engine.nLayout.LayoutEngine.visitContent(LayoutEngine.java:628)
	at org.eclipse.birt.report.engine.nLayout.LayoutEngine.visitContent(LayoutEngine.java:636)
	at org.eclipse.birt.report.engine.nLayout.LayoutEngine.startForeign(LayoutEngine.java:670)
	at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.startForeign(CompositeContentEmitter.java:266)
	at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:77)
	at org.eclipse.birt.report.engine.layout.html.HTMLTableLayoutEmitter.startContent(HTMLTableLayoutEmitter.java:146)
	at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startForeign(ContentEmitterAdapter.java:168)
	at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:77)
	at org.eclipse.birt.report.engine.layout.html.HTMLTableLayoutEmitter.startContent(HTMLTableLayoutEmitter.java:146)
	at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startForeign(ContentEmitterAdapter.java:168)
	at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:77)
	at org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBuffer.startContent(HTMLPageBuffer.java:116)
	at org.eclipse.birt.report.engine.layout.html.buffer.TableBreakBuffer.startContent(TableBreakBuffer.java:287)
	at org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.start(HTMLLeafItemLM.java:67)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:139)
	at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
	at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
	at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:111)
	at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutNodes(HTMLInlineStackingLM.java:160)
	at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
	at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
	at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
	at org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.layoutChildren(HTMLTableBandLM.java:67)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
	at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
	at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
	at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layoutChildren(HTMLTableLM.java:132)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
	at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
	at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
	at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:111)
	at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutNodes(HTMLInlineStackingLM.java:160)
	at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
	at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
	at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
	at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layoutChildren(HTMLTableLM.java:132)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
	at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
	at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90)
	at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:99)
	at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:180)
	at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
*******************************************************

Clearly this is because it is not handling the background-image very well.  In out case, we are using user-input to run the report, so we can't restrict against this form of useless HTML.

Reproducible: Always

Steps to Reproduce:
Run a PDF report, giving it HTML shown in the DETAILS above, and BIRT will fail to create the PDF, instead throwing the exception above.
Comment 1 Xiaoying Gu CLA 2012-04-13 05:02:26 EDT
I can not reproduce this issue with latest 3.7.2 release build.

Please try the latest release.