Nullpointer Exception on saving an Entity inherited from FileDocument, when associated parent object is new
Nullpointer Exception on saving an Entity inherited from FileDocument, when associated parent object is new. The example is: 2 entities - Loan and Payslip. A loan associated to many payslips. The Payslip entity inherits from FileDocument. So in the dataview of Loan I have a grid of associated Payslip. A new button invokes a microflow that creates an empty Payslip and set te reference to Loan and then shows a form with FileManager Upload. There is a out of box Save button on this form. When I click that Save I get Nullpointer exception. Modeler version 4.4. This error only occurs when my Loan is new. If I save Loan once then saving/uploading any Payslips goes fine. Stacktrace: java.lang.NullPointerException at fF.a(SourceFile:173) at com.mendix.core.Core.commit(SourceFile:540) at com.mendix.core.Core.commit(SourceFile:519) at gk.execute(SourceFile:40) at jd.a(SourceFile:319) at com.mendix.externalinterface.connector.RequestDispatching$Worker.a(SourceFile:170) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.a(SourceFile:161) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.apply(SourceFile:160) at akka.actor.Actor$class.apply(Actor.scala:545) at com.mendix.externalinterface.connector.RequestDispatching$Worker.apply(SourceFile:156) at akka.actor.LocalActorRef.invoke(ActorRef.scala:910) at akka.dispatch.MessageInvocation.invoke(MessageHandling.scala:25) at akka.dispatch.ExecutableMailbox$class.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:223) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:123) at akka.dispatch.ExecutableMailbox$class.run(ExecutorBasedEventDrivenDispatcher.scala:195) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.run(ExecutorBasedEventDrivenDispatcher.scala:123) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) at akka.dispatch.MonitorableThread.run(ThreadPoolBuilder.scala:192)
Tried the situation you described in Mendix version 4.4..4 and then I don't get the null pointer exception.
Maybe you could upgrade your project to this version?