Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0043532
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminoralways2020-03-20 13:542020-03-26 13:18
ReporterguillermogilView Statuspublic 
Assigned Toalostale 
PriorityhighResolutionopenFixed in Version
StatusscheduledFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version>=9
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0043532: 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] java.net.MalformedURLException: null
     [java] at java.net.URL.<init>(URL.java:679) ~[?:?]
     [java] at java.net.URL.<init>(URL.java:541) ~[?:?]
     [java] at java.net.URL.<init>(URL.java:488) ~[?:?]
     [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(Translate.java:251) [openbravo-trl.jar:?]
     [java] at org.openbravo.translate.Translate$1.visitFile(Translate.java:219) [openbravo-trl.jar:?]
     [java] at org.openbravo.translate.Translate$1.visitFile(Translate.java:208) [openbravo-trl.jar:?]
     [java] at java.nio.file.Files.walkFileTree(Files.java:2724) [?:?]
     [java] at java.nio.file.Files.walkFileTree(Files.java:2796) [?:?]
     [java] at org.openbravo.translate.Translate.execute(Translate.java:208) [openbravo-trl.jar:?]
     [java] at org.openbravo.translate.Translate.main(Translate.java:166) [openbravo-trl.jar:?]
     [java] Caused by: java.lang.NullPointerException
     [java] at java.net.URL.<init>(URL.java:585) ~[?:?]
     [java] ... 19 more
Steps To Reproduce1. Add to C_Order.jrxml the following:
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> [^]
2. Set core module in development
3. run ant smartbuild (sing JDK 11)
TagsNo tags attached.
Attached Filesdiff file icon 43532.diff [^] (846 bytes) 2020-03-25 13:11 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 00435913.0PR20Q1.1 scheduledalostale jrxml translate build step fails if using jasperreport.dtd 
depends on backport 00435923.0PR19Q4.4 scheduledalostale jrxml translate build step fails if using jasperreport.dtd 
blocks feature request 0037083 closedalostale support JDK 9 
Not all the children of this issue are yet resolved or closed.

-  Notes
(0118797)
shuehner (administrator)
2020-03-25 12:52

Hello,
the proposed solution is most likely wrong.
As it just disables functionality without needing it.

There is already code in place since here:
changeset: 673:d344659ef3bb
date: Thu Apr 17 09:49:26 2008 +0000

Which solved that problem (back then) by having a local copy for this specific dtd avoiding the need for the parser to download it.

But apparently that is now not working correctly in some cases.

So probably we should debug and fix that existing mechanism which should fix the issue without loosing the whole feature of validating the xml against its dtd
(0118798)
shuehner (administrator)
2020-03-25 12:59

Further testing shows this error to only happen if Translate java code is running with openjdk11 and it is NOT failing when running with openjdk8
(0118799)
shuehner (administrator)
2020-03-25 13:13

Talking about attached diff:
Move reading the dtd from jasper jar file to use ClassLoader defined for Translate.java itself. That way it sees the classpath we have defined in our builds.xml on invocation (project.class.path) and properly returns the resources.

Without the change running with Java11 the call returns null when using SystemClassLoader which apparently worked before until java8.
Comparing with the various other getResourceAsStream calls we have in pi they all call it on a concrete class which probably explains why the change in behavior from Java was hidden until now.

- Issue History
Date Modified Username Field Change
2020-03-20 13:54 guillermogil New Issue
2020-03-20 13:54 guillermogil Assigned To => platform
2020-03-20 13:54 guillermogil Modules => Core
2020-03-20 13:54 guillermogil Triggers an Emergency Pack => No
2020-03-20 13:55 alostale Severity major => minor
2020-03-20 13:55 alostale Type feature request => defect
2020-03-20 13:55 alostale Status new => acknowledged
2020-03-25 12:52 shuehner Note Added: 0118797
2020-03-25 12:59 shuehner Note Added: 0118798
2020-03-25 13:11 shuehner File Added: 43532.diff
2020-03-25 13:13 shuehner Note Added: 0118799
2020-03-26 12:01 alostale Relationship added blocks 0037083
2020-03-26 12:06 alostale Summary Compilation fails in case of an external dtd is used => jrxml translate build step fails if using jasperreport.dtd
2020-03-26 12:06 alostale Description Updated View Revisions
2020-03-26 12:06 alostale Steps to Reproduce Updated View Revisions
2020-03-26 12:06 alostale Proposed Solution updated
2020-03-26 12:07 alostale Description Updated View Revisions
2020-03-26 12:07 alostale Steps to Reproduce Updated View Revisions
2020-03-26 12:07 alostale Proposed Solution updated
2020-03-26 12:07 alostale Assigned To platform => alostale
2020-03-26 12:48 alostale Review Assigned To => caristu
2020-03-26 13:18 alostale Status acknowledged => scheduled


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker