Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0050879Openbravo ERPA. Platformpublic2022-11-14 11:402022-11-16 08:11
shuehner 
shuehner 
normalmajorhave not tried
closedfixed 
5
 
PR23Q1 
Core
No
0050879: junit HiddenUpdateTest fails with jdk19 on oracle
This junit testcase fails when runninging on:
- oracle (only oracle)
- jdk19 or higher

Error is triggered here when checking following table:
org.openbravo.test.dal.HiddenUpdateTest - Checking entity ADSystemInformation

Error message:
An invalid XML character (Unicode: 0xb) was found in the node's character data content.

caused at:
https://gitlab.com/openbravo/product/openbravo/-/blob/master/src/org/openbravo/dal/xml/EntityXMLConverter.java#L462 [^]

by the value ad_system_info.db_checksum

The raw value read from the db_checksum column is identical when running jdk11 (working) and jdk19 (failing).
Error seems to be triggered by the xml-construction inside jdk being stricter on jdk19.

In environment with:
- oracle (19)
- JDK19

Run the following junit test
ant run.test -Dtest=org.openbravo.test.dal.HiddenUpdateTest
No tags attached.
blocks feature request 0049432 new Triage Platform Base Support JDK19 
Issue History
2022-11-14 11:40shuehnerNew Issue
2022-11-14 11:40shuehnerAssigned To => Triage Platform Base
2022-11-14 11:40shuehnerModules => Core
2022-11-14 11:40shuehnerTriggers an Emergency Pack => No
2022-11-14 11:43shuehnerNote Added: 0143512
2022-11-14 11:43shuehnerRelationship addedblocks 0049432
2022-11-15 13:00shuehnerNote Edited: 0143512bug_revision_view_page.php?bugnote_id=0143512#r25116
2022-11-15 13:16hgbotNote Added: 0143609
2022-11-16 08:09hgbotResolutionopen => fixed
2022-11-16 08:09hgbotStatusnew => closed
2022-11-16 08:09hgbotNote Added: 0143669
2022-11-16 08:09hgbotFixed in Version => PR23Q1
2022-11-16 08:09hgbotNote Added: 0143670
2022-11-16 08:11alostaleAssigned ToTriage Platform Base => shuehner

Notes
(0143512)
shuehner   
2022-11-14 11:43   
(edited on: 2022-11-15 13:00)
Base-problem is apparently that our db_checksum value being calculated in ad_db_modified pl-function (defined in prescript-oracle) are not printed characters but some RAW value (16 bytes).
Probably we should have applied rawtohex(RAW) => varchar(32) when creating that function to get 32chars hex-encoded instead.

After discussion ALO/SHU:
- Skip that specific table ad_system_info inside this junit test
- As on oracle the db_checksum does contain invalid (for xml) characters

Discarded:
- Updating formatting of oracle db_checksum (to be hex)
  - checksum calculation + checking is done entirely inside pl-code so unaffected by this topic
  - Effort to change formatting would invalidate existing checksum
  - Overhead to deal with that (customer by customer or with extra migration code) is not worth it (for "just" fixing that specific but otherwise unrelated test-case).

(0143609)
hgbot   
2022-11-15 13:16   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/761 [^]
(0143669)
hgbot   
2022-11-16 08:09   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/761 [^]
(0143670)
hgbot   
2022-11-16 08:09   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: b2e38d14b5bd474ebff41e14d75746d37055e516
Author: Stefan Huehner <stefan.huehner@openbravo.com>
Date: 16-11-2022 07:08:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/b2e38d14b5bd474ebff41e14d75746d37055e516 [^]

Fixes ISSUE-50879. Fix HiddenUpdateTest on oracle with JDK19.

ad_system_info.db_checksum on oracle contains raw bytes instead of
printable hexadecimal version of the md5-checksum over the structure.

This junit tests reads the row including the raw bytes which in some
cases are invalid characters when being added to an xml document.
That is now being rejected when using JDK19+ where the xml-parser seems
to be more strict.

Changing the checksum formatting now long time later after introducing
it would invalidate existing value and require extra work on updates.

Instead skip this specific table in the JUnit testcase to avoid
triggering the problem.

---
M src-test/src/org/openbravo/test/dal/HiddenUpdateTest.java
---