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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0045726
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagerminorhave not tried2021-01-13 16:062022-02-01 07:24
ReportershuehnerView Statuspublic 
Assigned ToTriage Platform Base 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0045726: ant create.database fails with NPE if sourcedata contains table with BLOB columns without a value in the xml file (oracle only)

DescriptionPart 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 ReproducePut attached AD_IMAGE.xml example file into src-db/database/sourcedata folder
run ant create.database using Oracle database

Proposed SolutionImprove code instacktrace above to add handling for missing value (null) to the BLOB codepath avoiding to try to constuct a ByteArrayInputSteam with null.
TagsNo tags attached.
Attached Filesxml file icon AD_IMAGE.xml [^] (673 bytes) 2021-01-13 16:06

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
There are no notes attached to this issue.

- 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


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker