I am trying to import associations but from excel but getting java.lang.NullPointerException

0
Hi,    I would highly appreciate some help. The scenario is that we are building an event management application. From the legacy app, we have database exports (XLSX) including the members and events (with IDs) and an association table including which member was on which event (IdMember | IdEvent) I created IdOld fields in both the new member and event entity in Mendix domain model, installed Excel importer, and successfully imported the events and the members, but when I would like to import the associations (basically 2 columns with the old IDs) I am getting the following error.    Any idea what am I doing wrong, what should I try?  Import setup: https://lowcono.com/wp-content/uploads/2023/07/Screenshot-2023-07-01-080618.png    Thank you so much in advance! Error:  Error while importing 8 - Member Event association test 56 ms, because: com.mendix.replication.MendixReplicationException: java.lang.NullPointerException | VERSION: Mx5_20161013   The following error occurred when importing document: e-m-test.xlsx -------- com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreException: com.mendix.core.CoreException: Document could not be imported, because: com.mendix.replication.MendixReplicationException: java.lang.NullPointerException | VERSION: Mx5_20161013     at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:108) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreException: com.mendix.core.CoreException: Document could not be imported, because: com.mendix.replication.MendixReplicationException: java.lang.NullPointerException | VERSION: Mx5_20161013     at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:23) Caused by: com.mendix.core.CoreException: com.mendix.core.CoreException: Document could not be imported, because: com.mendix.replication.MendixReplicationException: java.lang.NullPointerException | VERSION: Mx5_20161013     at excelimporter.reader.ExcelImporter.startImport(ExcelImporter.java:127) Caused by: com.mendix.core.CoreException: Document could not be imported, because: com.mendix.replication.MendixReplicationException: java.lang.NullPointerException | VERSION: Mx5_20161013     at excelimporter.reader.readers.ExcelReader.importData(ExcelReader.java:374) Caused by: excelimporter.reader.readers.ExcelRuntimeException: com.mendix.replication.MendixReplicationException: java.lang.NullPointerException | VERSION: Mx5_20161013     at excelimporter.reader.readers.ExcelDataReader.readData(ExcelDataReader.java:45)     at excelimporter.reader.readers.ExcelReader.importData(ExcelReader.java:353)     at excelimporter.reader.ExcelImporter.startImport(ExcelImporter.java:118)     at excelimporter.actions.StartImportByTemplate.executeAction(StartImportByTemplate.java:61)     at excelimporter.actions.StartImportByTemplate.executeAction(StartImportByTemplate.java:25)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:58)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48)     at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.java:57)     at com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeSync$2(ActionManager.scala:104)     at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:20)     at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:103)     at com.mendix.basis.actionmanagement.UserActionCallBuilderImpl.execute(UserActionCallBuilderImpl.scala:57)     at com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:35)     at com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:11)     at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:38)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.$anonfun$execute$1(MicroflowObject.scala:32)     at scala.Option.flatMap(Option.scala:283)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.scala:29)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.scala:169)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.scala:116)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:58)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48)     at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.java:57)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.$anonfun$runMonitoredAction$1(CoreActionHandlerImpl.scala:59)     at com.mendix.basis.actionmanagement.ActionMonitoring$.$anonfun$monitor$1(ActionMonitoring.scala:52)     at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:20)     at com.mendix.basis.actionmanagement.ActionMonitoring$.monitor(ActionMonitoring.scala:52)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.runMonitoredAction(CoreActionHandlerImpl.scala:59)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:46)     at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.java:57)     at com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeAsync$3(ActionManager.scala:87)     at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:678)     at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467)     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)     at java.base/java.lang.Thread.run(Thread.java:834) Caused by: com.mendix.replication.MendixReplicationException: java.lang.NullPointerException | VERSION: Mx5_20161013     at com.mendix.replication.MendixReplicationException.addVersion(MendixReplicationException.java:51) Caused by: com.mendix.replication.MendixReplicationException: java.lang.NullPointerException     at com.mendix.replication.MetaInfoProcessor.startProcessing(MetaInfoProcessor.java:69) Caused by: java.lang.NullPointerException: null     at com.mendix.basis.objectmanagement.member.MendixObjectReferenceSetImpl.setValue(MendixObjectReferenceSetImpl.scala:74)     at com.mendix.basis.objectmanagement.member.MendixObjectReferenceSetImpl.setValue(MendixObjectReferenceSetImpl.scala:21)     at com.mendix.basis.objectmanagement.MendixObjectMember.setValue(MendixObjectMember.java:31)     at com.mendix.basis.objectmanagement.MendixObjectImpl.setValue(MendixObjectImpl.java:248)     at com.mendix.basis.objectmanagement.MendixObjectImpl.setValue(MendixObjectImpl.java:237)     at com.mendix.replication.MetaInfoProcessor.storeChangedObjects(MetaInfoProcessor.java:253)     at com.mendix.replication.MetaInfoProcessor.startProcessing(MetaInfoProcessor.java:57)     at com.mendix.replication.MetaInfo.startProcessingObjects(MetaInfo.java:439)     at com.mendix.replication.MetaInfo.finish(MetaInfo.java:198)     at excelimporter.reader.readers.ExcelRowProcessorImpl.finish(ExcelRowProcessorImpl.java:116)     at excelimporter.reader.readers.ExcelDataReader.readData(ExcelDataReader.java:39)     at excelimporter.reader.readers.ExcelReader.importData(ExcelReader.java:353)     at excelimporter.reader.ExcelImporter.startImport(ExcelImporter.java:118)     at excelimporter.actions.StartImportByTemplate.executeAction(StartImportByTemplate.java:61)     at excelimporter.actions.StartImportByTemplate.executeAction(StartImportByTemplate.java:25)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:58)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48)     at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.java:57)     at com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeSync$2(ActionManager.scala:104)     at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:20)     at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:103)     at com.mendix.basis.actionmanagement.UserActionCallBuilderImpl.execute(UserActionCallBuilderImpl.scala:57)     at com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:35)     at com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:11)     at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:38)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.$anonfun$execute$1(MicroflowObject.scala:32)     at scala.Option.flatMap(Option.scala:283)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.scala:29)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.scala:169)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.scala:116)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:58)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48)     at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.java:57)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.$anonfun$runMonitoredAction$1(CoreActionHandlerImpl.scala:59)     at com.mendix.basis.actionmanagement.ActionMonitoring$.$anonfun$monitor$1(ActionMonitoring.scala:52)     at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:20)     at com.mendix.basis.actionmanagement.ActionMonitoring$.monitor(ActionMonitoring.scala:52)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.runMonitoredAction(CoreActionHandlerImpl.scala:59)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:46)     at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.java:57)     at com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeAsync$3(ActionManager.scala:87)     at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:678)     at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467)     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)     at java.base/java.lang.Thread.run(Thread.java:834)    
asked
3 answers
0

Hi,

 

Sadly I don’t have a solutipn for your problem. But from my experience with the excel import and export modules. Most of my problems occured because template names were missing, the database was out of synsc or just the template was broke and I needed to recreate columns or some times delete and recreate the whole template.

 

Best of luck.

answered
0

Hi Peter,

 

It is caused because the key that defines the association does not exist. Can you check in your excel if all idMember and idEvent id’s have a match in the other sheet. For this I would use the Excel formula countif

 

=COUNTIF([events.xlsx]Sheet1!$A:$A;A2)

The line with the 0 in the column B has no match in events. You check similarly in the other sheet:

 

=COUNTIF([events.xlsx]Sheet1!$A:$A;A2)

 

You should clean up your excel file where the result of the check is 0. It is an inconsistency created in the old system.

 

If it is not a data inconsistency, and members can exist without events and vice versa, you should import both entities without the association and create a microflow with checking logic to make the association.

 

Go Make It

 

Marco

answered
0

Hi, 

 

I ended up creating a helper data entity, where I imported all the IDs and created a microflow which iterate through the list, create the associations and set the status of each line to “Imported”. 

 

 

answered