How to debug java.lang.NullPointerException

0
I have a "com.mendix.core.CoreException: java.lang.NullPointerException" error. Obviously it wants to get an object what is not available. How to find out what is missing when having such an error. com.mendix.core.CoreException: com.mendix.core.CoreException: java.lang.NullPointerException at iu.b(SourceFile:164) at com.mendix.core.Core.execute(SourceFile:187) at dx.execute(SourceFile:183) at jy.a(SourceFile:300) at jy.a(SourceFile:232) at jy.processRequest(SourceFile:183) at fA.a(SourceFile:75) at com.mendix.core.MxRuntime.processRequest(SourceFile:893) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:40) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Thread.java:662) Caused by: com.mendix.core.CoreException: java.lang.NullPointerException at iu.b(SourceFile:164) at com.mendix.core.Core.execute(SourceFile:187) at hg.a(SourceFile:70) at kW.a(SourceFile:66) at eO.executeAction(SourceFile:96) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) at iu.b(SourceFile:155) at com.mendix.core.Core.execute(SourceFile:187) at dx.execute(SourceFile:183) at jy.a(SourceFile:300) at jy.a(SourceFile:232) at jy.processRequest(SourceFile:183) at fA.a(SourceFile:75) at com.mendix.core.MxRuntime.processRequest(SourceFile:893) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:40) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.NullPointerException at hl.getMetaObjectAccessesWithXPath(SourceFile:378) at cB.a(SourceFile:1014) at dN.f(SourceFile:184) at dN.hasReadAccess(SourceFile:193) at dN.a(SourceFile:164) at dN.getValue(SourceFile:216) at aL.getValue(SourceFile:304) at dynamicreporting.queryBuilder.ReportColumn$MFValueParser.<init>(ReportColumn.java:141) at dynamicreporting.queryBuilder.ReportColumn.<init>(ReportColumn.java:96) at dynamicreporting.queryBuilder.ReportConfiguration.prepareConfiguration(ReportConfiguration.java:48) at dynamicreporting.queryBuilder.ReportConfiguration.<init>(ReportConfiguration.java:34) at dynamicreporting.exporter.excel.ExcelExporter.exportToFile(ExcelExporter.java:77) at dynamicreporting.actions.CreateExcelExport.executeAction(CreateExcelExport.java:44) at dynamicreporting.actions.CreateExcelExport.executeAction(CreateExcelExport.java:20) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) at iu.b(SourceFile:155) at com.mendix.core.Core.execute(SourceFile:187) at hg.a(SourceFile:70) at kW.a(SourceFile:66) at eO.executeAction(SourceFile:96) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) at iu.b(SourceFile:155) at com.mendix.core.Core.execute(SourceFile:187) at dx.execute(SourceFile:183) at jy.a(SourceFile:300) at jy.a(SourceFile:232) at jy.processRequest(SourceFile:183) at fA.a(SourceFile:75) at com.mendix.core.MxRuntime.processRequest(SourceFile:893) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:40) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Thread.java:662)
asked
2 answers
1

(SourceFile:184) at dN.hasReadAccess(SourceFile:193) at dN.a(SourceFile:164) at dN.getValue(SourceFile:216) at aL.getValue(SourceFile:304) at dynamicreporting.queryBuilder.ReportColumn$MFValueParser.<init>(ReportColumn.java:141) at dynamicreporting.queryBuilder.ReportColumn.<init>(ReportColumn.java:96) at dynamicreporting.queryBuilder.ReportConfiguration.prepareConfiguration(ReportConfiguration.java:48) at dynamicreporting.queryBuilder.ReportConfiguration.<init>(ReportConfiguration.java:34) at dynamicreporting.exporter.excel.ExcelExporter.exportToFile(ExcelExporter.java:77) at dynamicreporting.actions.CreateExcelExport.executeAction(CreateExcelExport.java:44) at dynamicreporting.actions.CreateExcelExport.executeAction(CreateExcelExport.java:20) at com.mendix.systemwideinterfaces.core.UserAction.execute

Seems to be related to a 'dynamicreporting' module, is it from the AppStore? If you have java code, I suggest adding try catches, with breakpoints in the catch, to find out under which circumstances the exception occur. Many try catches (with a throw in it) has the advantage that it provides more detailed 'Caused By' messages.

answered
1

Check the stacktrace, use the Microflow Debugger, try to figure out what exactly is happening (which activity causes the stacktrace, on what objects are you working etc)

It looks as though you either don't have a Session or you don't have a Context. Check your java source code to verify that all parameters are passed correctly.

answered