[#11381] - impossible to use ScriptletFactory

Category:
Bug report
Priority:
Normal
Status:
New
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

When a custom ScriptletFactory is registered via the extension mechanism the custom factory is never used. This is because the DefaultScriptletFactory throws an exception when a scriptlet could not be loaded. This is expected and the reason for a custom ScriptletFactory. Unfortunately the calling function (net.sf.jasperreports.engine.fill.JRFillDataset.createScriptlets() ) does not handle the exception and so the custom factory has no chance of creating the requested scriptlet.

I think JRFillDataset.createScriptlets should catch all exceptions and only rethrow one of them (possibly wrapped) if all registered ScriptletFactory implementations fail to load the scriptlet. Another solution would be to prevent DefaultScriptletFactory from throwing exceptions in the first place. Both solutions are complicated by the fact that ScriptletFactory attempts to load many (or all?) scriptlets from a report.

On a related note: DefaultScriptletFactory should probably not be a singleton so custom factories can extend from it. Collecting all the scriptlet class names out of the ScriptletFactoryContext is not trivial.

v6.5.1
JasperReports
thomas.reinhardt's picture
Joined: Nov 21 2018 - 7:06am
Last seen: 3 weeks 2 days ago

1 Comment:

#1

added jasperreports_extension.properties

AttachmentSize
Binary Data jasperreports_extension.properties118 bytes
Feedback
randomness