NullPointer exception but info not available
-
Hy,
i migrated an H2 database to mysql,
there's this error about every 10 seconds:ERROR 2018-11-12 14:49:38,838 (com.serotonin.m2m2.web.mvc.rest.v1.publisher.pointValue.PointValueWebSocketPublisher.pointUpdated:179) -
java.lang.NullPointerExceptionHow I can understand where's the problem?
Thanks,Antonio
-
Hi Antonio,
How I can understand where's the problem?
There's probably a stack trace under that logging statement, which would help with trying to understand. I can see that it would be there. https://github.com/infiniteautomation/ma-modules-public/blob/2.8.x/Mango API/src/com/serotonin/m2m2/web/mvc/rest/v1/publisher/pointValue/PointValueWebSocketPublisher.java#L179
-
Hy,
thanks for your reply,
I think that e.getMessage() incatch (Exception e) { LOG.error(e.getMessage(),e); }
gives only the short description of the exception, not the full stack trace
in fact in the log I've only a long sequence of :ERROR 2018-11-13 14:37:17,874 (com.serotonin.m2m2.web.mvc.rest.v1.publisher.pointValue.PointValueWebSocketPublisher.pointUpdated:179) - java.lang.NullPointerException ERROR 2018-11-13 14:37:27,887 (com.serotonin.m2m2.web.mvc.rest.v1.publisher.pointValue.PointValueWebSocketPublisher.pointUpdated:179) - java.lang.NullPointerException ERROR 2018-11-13 14:37:37,871 (com.serotonin.m2m2.web.mvc.rest.v1.publisher.pointValue.PointValueWebSocketPublisher.pointUpdated:179) - java.lang.NullPointerException ERROR 2018-11-13 14:37:47,886 (com.serotonin.m2m2.web.mvc.rest.v1.publisher.pointValue.PointValueWebSocketPublisher.pointUpdated:179) - java.lang.NullPointerException
it seems I've no way to understand which point is envolved.
In which case the class PointValueWebSocketPublisher.java
is invoked?It is not clear to me if all source code of Mango automation are available on git or just something and if there's a chance for me to debug the code directly on my machine using an eclipse JEE Ide?
Thanks,
Antonio -
@etantonio said in NullPointer exception but info not available:
It is not clear to me if all source code of Mango automation are available on git
99% of the core is available on Github and nothing stops you debugging this if you would like to. There is a small component of the code which is private but the jars are available in our Maven repository and will be automatically downloaded by Eclipse.
That said, I'd recommend upgrading to the latest version of Mango as there has been numerous bugs fixed around WebSockets.
-
@etantonio said in NullPointer exception but info not available:
gives only the short description of the exception, not the full stack trace
The second argument is the exception, which logs the stack trace.
It is not clear to me if all source code of Mango automation are available on git or just something and if there's a chance for me to debug the code directly on my machine using an eclipse JEE Ide?
Both the 2.8 core and the 2.8 ma-modules-public repos (which contains the Mango API module) are public. Yes you could clone them, launch Mango with the debugger enabled, and attach to it and debug (see the scripts in Mango/bin/ext-available for enabling the debugger).
The issue you're asking about was solved at some point in the years of updates since the 2.8 core.
You could also try launching at the command line in case some error information is escaping to stderr.
-
You are right, "e" gives the full stack trace, it is in sterr and is the following, but it seems there's no info about the point having problem, maybe just in debug I could find it.
Any suggestion is appreciatedERROR 2018-11-14 09:02:10,758 (com.serotonin.m2m2.web.mvc.rest.v1.publisher.pointValue.PointValueWebSocketPublisher.pointUpdated:179) - java.lang.NullPointerException at com.serotonin.m2m2.rt.dataImage.AnnotatedPointValueTime.getAnnotation(AnnotatedPointValueTime.java:39) at com.serotonin.m2m2.web.mvc.rest.v1.model.pointValue.PointValueTimeModel.<init>(PointValueTimeModel.java:67) at com.serotonin.m2m2.web.mvc.rest.v1.publisher.pointValue.PointValueWebSocketPublisher.pointUpdated(PointValueWebSocketPublisher.java:172) at com.serotonin.m2m2.rt.dataImage.DataPointRT$EventNotifyWorkItem.execute(DataPointRT.java:632) at com.serotonin.m2m2.rt.maint.BackgroundProcessing$1.run(BackgroundProcessing.java:73) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
-
I suspect you can find the cause and solution in this git issue: https://github.com/infiniteautomation/ma-core-public/issues/1098
You might be able to unzip a current mango-3.5.6.jar and take the AnnotatedPointValueTime class and override it.
-
@phildunlap said in NullPointer exception but info not available:
AnnotatedPointValueTime
Thanks,
it seems now it is ok,
it is necessary to add also the new interface IAnnotated.class.
Thanks,
Antonio -
Once you're modifying the code or overriding things you're accepting responsibility for making decisions about what's necessary.