Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] A. Platformminoralways2020-03-20 13:542020-04-02 08:46
ReporterguillermogilView Statuspublic 
Assigned Toalostale 
PriorityhighResolutionfixedFixed in Version3.0PR19Q4.4
StatusclosedFix in branchFixed in SCM revision084e45e1daf7
ProjectionnoneETAnoneTarget Version3.0PR19Q4.4
OSAnyDatabaseAnyJava version>=9
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0043592: jrxml translate build step fails if using jasperreport.dtd

DescriptionWhen a jrxml file makes use of jasperreport.dtd, translate build step fails executing with JDK 9+:

Compilation fails in case of an external dtd is used on a JRXML file:
     [java] 1770 [main] ERROR org.openbravo.translate.Translate - file: /XX/XX/XX/XX.jrxml
     [java] null
     [java] at<init>( ~[?:?]
     [java] at<init>( ~[?:?]
     [java] at<init>( ~[?:?]
     [java] at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) ~[xercesImpl.jar:?]
     [java] at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source) ~[xercesImpl.jar:?]
     [java] at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source) ~[xercesImpl.jar:?]
     [java] at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source) ~[xercesImpl.jar:?]
     [java] at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source) ~[xercesImpl.jar:?]
     [java] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) ~[xercesImpl.jar:?]
     [java] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl.jar:?]
     [java] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl.jar:?]
     [java] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[xercesImpl.jar:?]
     [java] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) ~[xercesImpl.jar:?]
     [java] at org.openbravo.translate.Translate.parseFile( [openbravo-trl.jar:?]
     [java] at org.openbravo.translate.Translate$1.visitFile( [openbravo-trl.jar:?]
     [java] at org.openbravo.translate.Translate$1.visitFile( [openbravo-trl.jar:?]
     [java] at java.nio.file.Files.walkFileTree( [?:?]
     [java] at java.nio.file.Files.walkFileTree( [?:?]
     [java] at org.openbravo.translate.Translate.execute( [openbravo-trl.jar:?]
     [java] at org.openbravo.translate.Translate.main( [openbravo-trl.jar:?]
     [java] Caused by: java.lang.NullPointerException
     [java] at<init>( ~[?:?]
     [java] ... 19 more
Steps To Reproduce1. Add to C_Order.jrxml the following:
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" ""> [^]
2. Set core module in development
3. run ant smartbuild (sing JDK 11)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0043532 closedalostale jrxml translate build step fails if using jasperreport.dtd 

-  Notes
hgbot (developer)
2020-03-30 10:28

Repository: erp/backports/3.0PR19Q4.4
Changeset: 084e45e1daf7976ace52d5b96f7577e14fe6f8aa
Author: Asier Lostalé <asier.lostale <at>>
Date: Thu Mar 26 12:25:43 2020 +0100
URL: [^]

fixed BUG-43592: jrxml translate build step fails if using jasperreport.dtd

Translate makes use of a custom EntityResolver to handle jasperreport.dtd
resolving it locally instead of getting it from Internet. This local
resolution is implemented making use of Class.getResourceAsStream
method. The class the method was invoked from was java.lang.System.

Starting from JDK 9, getResourceAsStream invoked in classes within named
Modules looks for the resources only in those modules rather than in the
whole classpath [1]:

  > If this class is in a named Module then this method will attempt to find
  > the resource in the module. This is done by delegating to the module's class
  > loader findResource(String,String) method, invoking it with the module name
  > and the absolute name of the resource. Resources in named modules are subject
  > to the rules for encapsulation specified in the Module getResourceAsStream
  > method and so this method returns null when the resource is a non-".class"
  > resource in a package that is not open to the caller's module.
  > Otherwise, if this class is not in a named module then the rules for searching
  > resources associated with a given class are implemented by the defining class
  > loader of the class. This method delegates to this object's class loader. If
  > this object was loaded by the bootstrap class loader, the method delegates to
  > ClassLoader.getSystemResourceAsStream(java.lang.String).

As java.lang.System is in a named Module, dtd's resource was tried to be found within
it and not found.

Fixed by invoking getResourceAsStream on LocalEntityResolver.class which
is not in a named module.

[1] [^]

M src-trl/src/org/openbravo/translate/
caristu (developer)
2020-04-02 08:46


- Issue History
Date Modified Username Field Change
2020-03-26 13:18 alostale Type defect => backport
2020-03-26 13:18 alostale Target Version => 3.0PR19Q4.4
2020-03-30 10:28 hgbot Checkin
2020-03-30 10:28 hgbot Note Added: 0118866
2020-03-30 10:28 hgbot Status scheduled => resolved
2020-03-30 10:28 hgbot Resolution open => fixed
2020-03-30 10:28 hgbot Fixed in SCM revision => [^]
2020-04-02 08:46 caristu Note Added: 0118910
2020-04-02 08:46 caristu Status resolved => closed
2020-04-02 08:46 caristu Fixed in Version => 3.0PR19Q4.4

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker