Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0054490Openbravo ERPY. DBSourceManagerpublic2024-01-29 13:422024-03-06 18:06
shuehner 
Triage Platform Base 
normalmajorhave not tried
closedfixed 
5
 
PR24Q2 
Core
No
0054490: update.database fails with jdk21
Running update.database with jdk21 fails with following error:


     [java] 24523 [main] INFO org.openbravo.ddlutils.task.AlterDatabaseDataAll - Executing script postscript-PostgreSql.sql
     [java] 24535 [main] INFO org.apache.ddlutils.platform.PGStandardBatchEvaluator - Executed 10 SQL command(s) successfully in 12 ms
     [java] 25413 [main] ERROR org.apache.commons.betwixt.io.AbstractBeanWriter - [MethodExpression] Cannot evaluate method public default java.lang.Object java.util.List.getFirst()
     [java] java.lang.reflect.InvocationTargetException: null
     [java] at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118) ~[?:?]
     [java] at java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
     [java] at org.apache.commons.betwixt.expression.MethodExpression.evaluate(MethodExpression.java:62) [commons-betwixt-0.8.jar:0.8]
     [java] at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElementContent(AbstractBeanWriter.java:940) [commons-betwixt-0.8.jar:0.8]
     [java] at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(AbstractBeanWriter.java:756) [commons-betwixt-0.8.jar:0.8]
     [java] at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:391) [commons-betwixt-0.8.jar:0.8]
     [java] at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:245) [commons-betwixt-0.8.jar:0.8]
     [java] at org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.java:146) [commons-betwixt-0.8.jar:0.8]
     [java] at org.apache.commons.betwixt.io.BeanWriter.write(BeanWriter.java:211) [commons-betwixt-0.8.jar:0.8]
     [java] at org.apache.ddlutils.io.DatabaseIO.write(DatabaseIO.java:549) [dbsourcemanager.jar:?]
     [java] at org.openbravo.ddlutils.process.DBUpdater.checkFormalChanges(DBUpdater.java:311) [dbsourcemanager.jar:?]
     [java] at org.openbravo.ddlutils.process.DBUpdater.update(DBUpdater.java:141) [dbsourcemanager.jar:?]
     [java] at org.openbravo.ddlutils.task.AlterDatabaseDataAll.doExecute(AlterDatabaseDataAll.java:59) [dbsourcemanager.jar:?]
     [java] at org.openbravo.ddlutils.task.BaseDatabaseTask.execute(BaseDatabaseTask.java:56) [dbsourcemanager.jar:?]
     [java] at org.openbravo.ddlutils.task.AlterDatabaseJava.main(AlterDatabaseJava.java:63) [dbsourcemanager.jar:?]
backoffice context with jdk21
Run update.database

alternatively:
- run try (backoffice) with jdk21
- check build output of try-upgrade-pgsql job
  - specifically it running update.database
  - Note: Job nor update.database fails (need to check output)

alternatively:
- run dbsm junit tests (with jdk21)
  They show 7 tests failing all related to this issue
No tags attached.
depends on backport 0054526PR24Q1.1 closed Triage Platform Base update.database fails with jdk21 
related to defect 0056729 new Triage Platform Base export.config.script produces wrong data when run with jdk21 (that causes later update.database to fail) 
blocks feature request 0054449 new Triage Platform Base Support JDK21 (LTS) 
causes defect 0056039 scheduled AugustoMauch ant export.config.script fails when formalChangesScript.xml contains no formal changes 
Issue History
2024-01-29 13:42shuehnerNew Issue
2024-01-29 13:42shuehnerAssigned To => Triage Platform Base
2024-01-29 13:42shuehnerModules => Core
2024-01-29 13:42shuehnerTriggers an Emergency Pack => No
2024-01-29 13:42shuehnerRelationship addedblocks 0054449
2024-01-29 13:44shuehnerSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=27414#r27414
2024-01-29 16:20hgbotNote Added: 0159887
2024-01-29 16:21shuehnerSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=27415#r27415
2024-01-31 14:09shuehnerStatusnew => scheduled
2024-01-31 14:09shuehnerNote Added: 0160011
2024-02-05 14:50hgbotNote Added: 0160261
2024-03-06 18:05hgbotNote Added: 0161782
2024-03-06 18:05hgbotNote Added: 0161783
2024-03-06 18:06hgbotResolutionopen => fixed
2024-03-06 18:06hgbotStatusscheduled => closed
2024-03-06 18:06hgbotFixed in Version => PR24Q2
2024-03-06 18:06hgbotNote Added: 0161784
2024-03-06 18:06hgbotNote Added: 0161785
2024-07-17 10:07shuehnerRelationship addedcauses 0056039
2024-10-10 11:42shuehnerRelationship addedrelated to 0056729

Notes
(0159887)
hgbot   
2024-01-29 16:20   
Merge Request created: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/45 [^]
(0160011)
shuehner   
2024-01-31 14:09   
Add 24Q1 backport to be able to have Q1 a supported for jdk21 (as inititally planned)
(0160261)
hgbot   
2024-02-05 14:50   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1125 [^]
(0161782)
hgbot   
2024-03-06 18:05   
Repository: https://gitlab.com/openbravo/product/dbsm [^]
Changeset: a68e966b12feb9abd64b935a1a7d3899ed62e525
Author: Stefan Huehner <stefan.huehner@openbravo.com>
Date: 29-01-2024 16:16:11
URL: https://gitlab.com/openbravo/product/dbsm/-/commit/a68e966b12feb9abd64b935a1a7d3899ed62e525 [^]

ISSUE-54490: Fix update.databse with jdk21

When running with jdk21 update.databse fails near its end in
checkFormalChanges.
Problem is that BeanWriter.write(Vector<Change>) fails when being passed
an empty list.

Only call with when the actual list has entries to avoid the problem.

Note that underlying cause seems to be betwixt library not working
cleanly with jdk21.
RM-11112 is already reported with the goal to remove/replace
betwixt library entirely some time later.

---
M src/org/apache/ddlutils/io/DatabaseIO.java
---
(0161783)
hgbot   
2024-03-06 18:05   
Merge request merged: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/45 [^]
(0161784)
hgbot   
2024-03-06 18:06   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 9258860594bc4688846c4ea9d2c3ca7eb4b76d5c
Author: Stefan Huehner <stefan.huehner@openbravo.com>
Date: 06-03-2024 17:05:08
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/9258860594bc4688846c4ea9d2c3ca7eb4b76d5c [^]

Fixed ISSUE-54490: Fix update.database with jdk21

When running with jdk21 update.databse fails near its end in
checkFormalChanges.

Note that underlying cause seems to be betwixt library not working
cleanly with jdk21.
RM-11112 is already reported with the goal to remove/replace
betwixt library entirely some time later.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0161785)
hgbot   
2024-03-06 18:06   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1125 [^]