Openbravo Issue Tracking System - Openbravo ERP | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0045726 | Openbravo ERP | Y. DBSourceManager | public | 2021-01-13 16:06 | 2022-02-01 07:24 |
Reporter | shuehner | ||||
Assigned To | Triage Platform Base | ||||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | new | Resolution | open | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Merge Request Status | |||||
Review Assigned To | |||||
OBNetwork customer | |||||
Web browser | |||||
Modules | Core | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0045726: ant create.database fails with NPE if sourcedata contains table with BLOB columns without a value in the xml file (oracle only) | ||||
Description | Part of create.database is loading sourcedata from the xml files into the database. If a table is loaded and it contains a column of type="BLOB" and the xml file being loaded does not have a value for this field (meaning not having a line in the xml file for this table) then ant create.database fails with a NullPointerException. That error only happens when using Oracle datbase (tested both ora11 and ora19) Error happens on both 19Q3 tag and master/head (development for 21Q2) Caused by: org.apache.ddlutils.io.DataSinkException: java.lang.NullPointerException at org.apache.ddlutils.io.DataToDatabaseSink.purgeBatchQueue(DataToDatabaseSink.java:409) at org.apache.ddlutils.io.DataToDatabaseSink.insertBeanIntoDatabase(DataToDatabaseSink.java:383) at org.apache.ddlutils.io.DataToDatabaseSink.addBean(DataToDatabaseSink.java:314) at org.apache.ddlutils.io.DynaSqlCreateRule.end(DynaSqlCreateRule.java:84) at org.apache.commons.digester.Digester.endElement(Digester.java:1233) ... 57 more Caused by: java.lang.NullPointerException at java.base/java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:108) at org.apache.ddlutils.platform.PlatformImplBase.setStatementParameterValue(PlatformImplBase.java:2765) at org.apache.ddlutils.platform.PlatformImplBase.setObject(PlatformImplBase.java:2720) at org.apache.ddlutils.platform.PlatformImplBase.insert(PlatformImplBase.java:1867) at org.apache.ddlutils.io.DataToDatabaseSink.purgeBatchQueue(DataToDatabaseSink.java:399) ... 61 more Important note: This is the end of the relevant error stacktrace. Earlier parts as misleading and point to 'xml parsing error for an unrelated table' Cause is dbsourcemanager using batchMode(true) for the data loading so the error is happening and the end of the batch (even if problem is caused way earlier) | ||||
Steps To Reproduce | Put attached AD_IMAGE.xml example file into src-db/database/sourcedata folder run ant create.database using Oracle database | ||||
Proposed Solution | Improve code instacktrace above to add handling for missing value (null) to the BLOB codepath avoiding to try to constuct a ByteArrayInputSteam with null. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | AD_IMAGE.xml (673) 2021-01-13 16:06 https://issues.openbravo.com/file_download.php?file_id=15247&type=bug | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2021-01-13 16:06 | shuehner | New Issue | |||
2021-01-13 16:06 | shuehner | Assigned To | => platform | ||
2021-01-13 16:06 | shuehner | File Added: AD_IMAGE.xml | |||
2021-01-13 16:06 | shuehner | Modules | => Core | ||
2021-01-13 16:06 | shuehner | Triggers an Emergency Pack | => No | ||
2021-01-13 17:28 | shuehner | Category | A. Platform => Y. DBSourceManager | ||
2022-02-01 07:24 | alostale | Assigned To | platform => Triage Platform Base |
There are no notes attached to this issue. |