View Issue Details

IDProjectCategoryView StatusLast Update
0004940SymmetricDSBugpublic2022-01-13 13:28
Reportersymds-tryout Assigned Toelong  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.12.8 
Target Version3.12.9Fixed in Version3.12.9 
Summary0004940: NullPointerException in TriggerRouterService after conflict resolution (NEWER_WINS)
DescriptionAfter Conflict resolution, a NPE occurs inside TriggerRouterService.getActiveTriggerHistories(tableName) (line 458)
because tableName has never been set.

Steps To ReproduceSymmetricDS 3.12.8 configured between Android (Emulation) ("store") and MySQL (Windows) ("corp"), following the old NotePad example.
Conflict handling set to USE_CHANGED_DATA, NEWER_WINS.

Provoked a conflict by updating an existing record on both sides while Android emulation was switched to Flight Mode.
When turning FlightMode off again, the following conflict resolution on Windows side leads to a NPE in TriggerRouterService.getActiveTriggerHistory (line 458)
because tableName is null (see screenshot 1 for variables and call stack).
This seems to happen because during performFallbackToUpdate a CsvData instance is created (see screenshot 2) without tableName being set
into CsvData (see Screenshot 3) ... and it is also not set later on.
But later on in handleWinnerForNewerCaptureWins SymmetricDS tries to retrieve the tableName from that CsvData (see screenshot 4, line 197).
Additional Information2021-04-05 13:38:31,660 DEBUG [corp-000] [DefaultDatabaseWriter] [corp-000-dataloader-7] Preparing dml: update `corp`.`notes` set `NOTE` = ?, `TITLE` = ?, `CREATED` = ?, `MODIFIED` = ? where `NOTE` = ? and `TITLE` = ? and `CREATED` = ? and `MODIFIED` = ? and `_ID` = ?
2021-04-05 13:38:31,660 DEBUG [corp-000] [DefaultDatabaseWriter] [corp-000-dataloader-7] Submitting data ['HelloWorld', 'Odysseus', '2021-04-05 13:35:21.0', '2021-04-05 13:37:45.156', 'HelloWorld', 'Odysseus', '2021-04-05 13:35:21.0', '2021-04-05 13:35:21.0', '37'] with types [LONGVARCHAR, LONGVARCHAR, VARCHAR, VARCHAR, LONGVARCHAR, LONGVARCHAR, VARCHAR, VARCHAR, VARCHAR]
2021-04-05 13:38:31,661 DEBUG [corp-000] [JdbcSqlTransaction] [corp-000-dataloader-7] (1ms.) update `corp`.`notes` set `NOTE` = 'HelloWorld', `TITLE` = 'Odysseus', `CREATED` = '2021-04-05 13:35:21.0', `MODIFIED` = '2021-04-05 13:37:45.156' where `NOTE` = 'HelloWorld' and `TITLE` = 'Odysseus' and `CREATED` = '2021-04-05 13:35:21.0' and `MODIFIED` = '2021-04-05 13:35:21.0' and `_ID` = '37'
2021-04-05 13:38:31,661 DEBUG [corp-000] [AbstractDatabaseWriterConflictResolver] [corp-000-dataloader-7] Conflict detected: NOTES in batch 001-112 at line 1 for table corp.notes
2021-04-05 13:38:31,661 DEBUG [corp-000] [AbstractDatabaseWriterConflictResolver] [corp-000-dataloader-7] Row data: "37","HelloWorld","Odysseus","2021-04-05 13:35:21.0","2021-04-05 13:37:45.156"
2021-04-05 13:38:31,661 DEBUG [corp-000] [AbstractDatabaseWriterConflictResolver] [corp-000-dataloader-7] Old data: "37","HelloWorld","Odysseus","2021-04-05 13:35:21.0","2021-04-05 13:35:21.0"
2021-04-05 13:38:31,665 DEBUG [corp-000] [DefaultDatabaseWriterConflictResolver] [corp-000-dataloader-7] Winning row from batch 001-112 with local time of null and remote time of null for table notes and pk of {37}
2021-04-05 13:38:31,667 DEBUG [corp-000] [JdbcSqlTransaction] [corp-000-dataloader-7] (0ms.) set @sync_triggers_disabled=null
2021-04-05 13:38:31,667 DEBUG [corp-000] [JdbcSqlTransaction] [corp-000-dataloader-7] (0ms.) set @sync_node_disabled=null
2021-04-05 13:38:31,667 DEBUG [corp-000] [DefaultDatabaseWriter] [corp-000-dataloader-7] Preparing dml: update `corp`.`notes` set `NOTE` = ?, `TITLE` = ?, `CREATED` = ?, `MODIFIED` = ? where `_ID` = ?
2021-04-05 13:38:31,667 DEBUG [corp-000] [DefaultDatabaseWriter] [corp-000-dataloader-7] Submitting data ['HelloWorld', 'Odysseus', '2021-04-05 13:35:21.0', '2021-04-05 13:37:45.156', '37'] with types [LONGVARCHAR, LONGVARCHAR, VARCHAR, VARCHAR, VARCHAR]
2021-04-05 13:38:31,668 DEBUG [corp-000] [JdbcSqlTransaction] [corp-000-dataloader-7] (1ms.) update `corp`.`notes` set `NOTE` = 'HelloWorld', `TITLE` = 'Odysseus', `CREATED` = '2021-04-05 13:35:21.0', `MODIFIED` = '2021-04-05 13:37:45.156' where `_ID` = '37'
2021-04-05 13:38:31,669 INFO [corp-000] [DefaultDatabaseWriter] [corp-000-dataloader-7] Failed to process update event in batch 001-112 on channel 'default'.
Failed pk data was: "37"
Failed row data was: "37","HelloWorld","Odysseus","2021-04-05 13:35:21.0","2021-04-05 13:37:45.156"
Failed old data was: "37","HelloWorld","Odysseus","2021-04-05 13:35:21.0","2021-04-05 13:35:21.0"
 StackTraceKey.init [NullPointerException:1359943660] java.lang.NullPointerException
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.getActiveTriggerHistories(TriggerRouterService.java:458)
    at org.jumpmind.symmetric.load.DefaultDataLoaderFactory$1.handleWinnerForNewerCaptureWins(DefaultDataLoaderFactory.java:199)
    at org.jumpmind.symmetric.load.DefaultDataLoaderFactory$1.afterResolutionAttempt(DefaultDataLoaderFactory.java:185)
    at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriterConflictResolver.performFallbackToUpdate(AbstractDatabaseWriterConflictResolver.java:370)
    at org.jumpmind.symmetric.io.data.writer.DefaultTransformWriterConflictResolver.performFallbackToUpdate(DefaultTransformWriterConflictResolver.java:105)
    at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriterConflictResolver.performChainedFallbackForUpdate(AbstractDatabaseWriterConflictResolver.java:220)
    at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriterConflictResolver.needsResolved(AbstractDatabaseWriterConflictResolver.java:104)
    at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter.write(AbstractDatabaseWriter.java:216)
    at org.jumpmind.symmetric.io.data.writer.NestedDataWriter.write(NestedDataWriter.java:64)
    at org.jumpmind.symmetric.model.ProcessInfoDataWriter.write(ProcessInfoDataWriter.java:84)
    at org.jumpmind.symmetric.io.data.writer.TransformWriter.write(TransformWriter.java:194)
    at org.jumpmind.symmetric.io.data.DataProcessor.forEachDataInTable(DataProcessor.java:212)
    at org.jumpmind.symmetric.io.data.DataProcessor.forEachTableInBatch(DataProcessor.java:178)
    at org.jumpmind.symmetric.io.data.DataProcessor.process(DataProcessor.java:124)
    at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener$2.call(DataLoaderService.java:1091)
    at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener$2.call(DataLoaderService.java:1067)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Tagsconflict manager

Relationships

duplicate of 0004941 closedelong Null pointer on registration when conflict resolution is needed 

Activities

symds-tryout

2021-04-05 20:48

reporter  

symds2.jpg (256,217 bytes)   
symds2.jpg (256,217 bytes)   
symds3.jpg (64,364 bytes)   
symds3.jpg (64,364 bytes)   
symds4.jpg (251,921 bytes)   
symds4.jpg (251,921 bytes)   
symds1.jpg (197,489 bytes)   
symds1.jpg (197,489 bytes)   

Issue History

Date Modified Username Field Change
2021-04-05 20:48 symds-tryout New Issue
2021-04-05 20:48 symds-tryout Tag Attached: conflict manager
2021-04-05 20:48 symds-tryout Tag Attached: NEWER_WINS
2021-04-05 20:48 symds-tryout File Added: symds2.jpg
2021-04-05 20:48 symds-tryout File Added: symds3.jpg
2021-04-05 20:48 symds-tryout File Added: symds4.jpg
2021-04-05 20:48 symds-tryout File Added: symds1.jpg
2021-04-05 21:51 elong Relationship added duplicate of 0004941
2021-04-05 21:52 elong Assigned To => elong
2021-04-05 21:52 elong Status new => assigned
2021-04-05 21:52 elong Status assigned => resolved
2021-04-05 21:52 elong Resolution open => fixed
2021-04-05 21:52 elong Fixed in Version => 3.12.9
2021-05-07 13:06 elong Status resolved => closed
2021-05-07 13:06 elong Target Version => 3.12.9
2022-01-13 13:28 admin Tag Detached: NEWER_WINS