mendix / OPC-UA-Connector

Connector module to communicate with an OPC UA Server
2 stars 3 forks source link

Not able to browse Kepware OPC Server #1

Open hazaart opened 3 years ago

hazaart commented 3 years ago

I have added a connection to an OPC-UA enabled local KepServer instance. The connection has been configured and the 'test connection' button returns succes.

However, when browsing for the nodes, reading or writing, only exceptions are occuring.

image

The full stacktrace for browsing the root node from a clean Kepware installation:

com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.NullPointerException at com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:156)

Caused by: java.lang.NullPointerException at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:30)

Caused by: null at org.eclipse.milo.opcua.stack.core.types.builtin.NodeId.parse(NodeId.java:361) at opcuaclientmx.actions.OpcUaRead.executeAction(OpcUaRead.java:49) at opcuaclientmx.actions.OpcUaRead.executeAction(OpcUaRead.java:25) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:49) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:54) at com.mendix.basis.actionmanagement.ActionManagerBase$1.execute(ActionManagerBase.java:147) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:26) at com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:152) at com.mendix.basis.actionmanagement.UserActionCallBuilderImpl.execute(UserActionCallBuilderImpl.scala:30) at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:56) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.$anonfun$execute$1(MicroflowObject.scala:32) at scala.Option.flatMap(Option.scala:283) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.scala:29) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.$anonfun$executeAfterBreakingIfNecessary$2(MicroflowImpl.scala:172) at scala.Option.flatMap(Option.scala:283) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.scala:172) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.scala:119) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:49) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:54) at com.mendix.basis.actionmanagement.DefaultActionMonitor$.$anonfun$run$1(CustomMonitoredAction.scala:18) at com.mendix.basis.actionmanagement.IMonitoredAction$$anon$1.execute(IMonitoredAction.scala:47) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:26) at com.mendix.basis.actionmanagement.IMonitoredAction.monitor(IMonitoredAction.scala:49) at com.mendix.basis.actionmanagement.IMonitoredAction.monitor$(IMonitoredAction.scala:25) at com.mendix.basis.actionmanagement.CustomMonitoredAction.monitor(CustomMonitoredAction.scala:22) at com.mendix.basis.actionmanagement.DefaultActionMonitor$.run(CustomMonitoredAction.scala:18) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.runMonitoredAction(CoreActionHandlerImpl.scala:60) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:47) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:54) at com.mendix.basis.actionmanagement.ActionManager.$anonfun$execute$1(ActionManager.scala:118) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:672) at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:431) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)

jaspervanderhoek commented 2 years ago

I don't have access to a Kepware server, would you be able to share some additional details with me so I can reproduce this? I think I've pinpointed the problem during the initial browse the NodeId isn't correctly being set but I don't see why.

Would you be able to place a breakpoint in microflow: 'OpcUaNode_Browse_TopLevel' and share with me the String variable 'BrowseResult' that is the output of the Browse activity. If you could provide that to me I can troubleshoot with that info.