• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    NullPointer exception but info not available

    Scheduled Pinned Locked Moved Mango Automation general Discussion
    9 Posts 3 Posters 2.5k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E Offline
      etantonio
      last edited by

      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.NullPointerException

      How I can understand where's the problem?
      Thanks,

      Antonio

      1 Reply Last reply Reply Quote 0
      • phildunlapP Offline
        phildunlap
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • E Offline
          etantonio
          last edited by

          Hy,
          thanks for your reply,
          I think that e.getMessage() in

          catch (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

          Jared WiltshireJ 1 Reply Last reply Reply Quote 0
          • Jared WiltshireJ Offline
            Jared Wiltshire @etantonio
            last edited by

            @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.

            Developer at Radix IoT

            1 Reply Last reply Reply Quote 0
            • phildunlapP Offline
              phildunlap
              last edited by

              @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.

              1 Reply Last reply Reply Quote 0
              • E Offline
                etantonio
                last edited by

                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 appreciated

                ERROR 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)
                
                1 Reply Last reply Reply Quote 0
                • phildunlapP Offline
                  phildunlap
                  last edited by

                  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.

                  1 Reply Last reply Reply Quote 0
                  • E Offline
                    etantonio
                    last edited by

                    @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

                    1 Reply Last reply Reply Quote 0
                    • phildunlapP Offline
                      phildunlap
                      last edited by

                      Once you're modifying the code or overriding things you're accepting responsibility for making decisions about what's necessary.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post