Diagnostic Link Null Pointer In 7.9 Driver

When upgrading to 7.9 I click the “Diagnostics” link of a device created using my module I get a null pointer exception despite this working in 7.7.
Comparing my module to the Modbus SDK example I can’t see what is missing. As far as I can tell, the xyzDriverType that extends DriverType has a getLinks() function which simply needs to include new DiagnosticsLink() as one of the List items returned.
I believe the DiagnosticsLink object is entirely handled in code outside my control, and not referencing anything that I should be creating.

Is my understanding of the DiagnosticsLink object being ‘contained’ wrong? And if so, could you please point me to the resources I need to maintain in order for the DiagnosticsLink to function correctly?

Thanks in advance

Null Pointer Error encountered when clicking the “Diagnostics” link:

org.apache.wicket.WicketRuntimeException: Method onLinkClicked of interface org.apache.wicket.markup.html.link.ILinkListener targeted at [ConfigPanelNavLink [Component id = link]] on component [ConfigPanelNavLink [Component id = link]] threw an exception
at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:268)
at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)
at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:240)
[… most frames omitted]
Caused by: java.lang.NullPointerException: null
at com.inductiveautomation.xopc.driver.util.diagnostics.DiagnosticsPage.getMenuLocation(DiagnosticsPage.java:77)
at com.inductiveautomation.ignition.gateway.web.pages.Config.setConfigPanel(Config.java:180)
at com.inductiveautomation.ignition.gateway.web.components.ConfigPanelNavLink.onClick(ConfigPanelNavLink.java:46)
at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:189)

[see attached for a more verbose log]
wrapper.log (4.1 KB)

Hmm.

DiagnosticsLink should have never been part of the driver API. I think it only got put there so our various drivers could access it in a shared manner.

Unfortunately the DiagnosticsLink and DiagnosticPage you see in versions prior to 7.9 no longer work. They were replaced with new React-based status pages.

If your driver extends AbstractDriver then you should automatically get one of these new pages because it implements Driver.getDriverMetrics() for you. Just stop adding your DiagnosticsLink manually.

If it doesn’t, you can either implement Drvier.getDriverMetrics(), which is oriented towards drivers that are based around polling, or your own custom page entirely by Driver.getDriverStatusJSUrl() and Driver.getDriverStatusJSLibName() and being the first 3rd party developer to attempt adding a custom React page to the gateway…

Please, please, please be the guinea pig! And tells us all about it!

1 Like

Thank you for the quick reply!
Sadly simply removing the addition of the DiagnosticsLink didn’t “fix” the problem, but I have created a task to follow up with your other suggestions.