Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0054526Openbravo ERPY. DBSourceManagerpublic2024-01-29 13:422024-03-08 13:34
shuehner 
Triage Platform Base 
normalmajorhave not tried
closedfixed 
5
 
PR24Q1.1PR24Q1.1 
Core
No
0054526: 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.
blocks defect 0054490 closed Triage Platform Base update.database fails with jdk21 
Issue History
2024-01-31 14:09shuehnerTypedefect => backport
2024-01-31 14:09shuehnerTarget Version => PR24Q1
2024-02-13 13:50AugustoMauchTarget VersionPR24Q1 => PR24Q1.1
2024-03-04 15:25hgbotNote Added: 0161627
2024-03-04 15:34hgbotNote Added: 0161628
2024-03-08 13:23hgbotNote Added: 0161896
2024-03-08 13:23hgbotNote Added: 0161897
2024-03-08 13:34hgbotResolutionopen => fixed
2024-03-08 13:34hgbotStatusscheduled => closed
2024-03-08 13:34hgbotFixed in Version => PR24Q1.1
2024-03-08 13:34hgbotNote Added: 0161898
2024-03-08 13:34hgbotNote Added: 0161899

Notes
(0161627)
hgbot   
2024-03-04 15:25   
Merge Request created: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/47 [^]
(0161628)
hgbot   
2024-03-04 15:34   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1160 [^]
(0161896)
hgbot   
2024-03-08 13:23   
Merge request merged: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/47 [^]
(0161897)
hgbot   
2024-03-08 13:23   
Repository: https://gitlab.com/openbravo/product/dbsm [^]
Changeset: 46963c806c37bb05bd28aadb62696e24cb427996
Author: Stefan Huehner <stefan.huehner@openbravo.com>
Date: 04-03-2024 15:24:46
URL: https://gitlab.com/openbravo/product/dbsm/-/commit/46963c806c37bb05bd28aadb62696e24cb427996 [^]

ISSUE-54526 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
---
(0161898)
hgbot   
2024-03-08 13:34   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 3e812c5f80de03ba368f280590f8edc4c00eef38
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 08-03-2024 12:34:38
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/3e812c5f80de03ba368f280590f8edc4c00eef38 [^]

Fixes ISSUE-54526: Fix update.database with jdk21

---
M src-db/database/lib/dbsourcemanager.jar
---
(0161899)
hgbot   
2024-03-08 13:34   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1160 [^]