I have a ticket open for the same issue. It seems to be related with people using the Back button of their browser.
Mendix only keeps a history of 5 actions, so after that it would open a form without having the NPE object for it. This then results in this stacktrace.
I run into the same error when i'm developing. I have a page that has a Non persistent as the caller, and if I rerun locally while on that page, I think the object is garbage collected, which causes the page to be open without the object.
I have also ran into a similar issue with a page that has a non persistent as the caller, and uses a reference selector to display data. It would repeatedly throw a similar error while trying to load the page.
Our users using 'back' buttons sounds plausible. We'll look into that. I don't think custom widgets or java calls are involved. Then we would have encountered it in our own tests. Apparently we don't use 'back' in our browsers. Thanks for the suggestions.
I faced a similar issue recently and figured out how to solve it, so I’m sharing that info in case it helps future users.
Our app is on Studio Pro 8.12.6. We were passing in a non-persistable entity X on the page. I was doing some refactoring on the page when I encountered the error. The error message was complaining about the Xpath in a listview, which didn’t mention the NPE at all.
What had happened was there was a widget – Check-box filter – and it had an XPath constraint for the checked state, and that XPath constraint referenced to the ‘[%CurrentObject%]’, which was pointed to the page parameter. I needed to wrap that widget in a dataview, that grabbed the actual persistent entity that I needed, to make the XPath execute correctly
So, my advice (to those reading this thread): Check the other widgets on the offending page, and check their XPaths.