连接到远程 OPCUA 服务器的问题
Issue connecting to remote OPCUA server
我是 opcua 的新手。
我已经尝试了 https://dentrassi.de/2017/09/14/creating-opc-ua-solutions-eclipse-milo/ 中的示例并设法连接到本地 OPCUA 服务器但不是远程服务器。
错误如下所示:
Exception in thread "main" java.util.concurrent.ExecutionException: java.nio.channels.UnresolvedAddressException
at java.util.concurrent.CompletableFuture.reportGet(Unknown Source)
at java.util.concurrent.CompletableFuture.get(Unknown Source)
at com.programcreek.helloworld.test2.main(test2.java:101)
Caused by: java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChannel.java:209)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:207)
at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1279)
at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:453)
at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:439)
at io.netty.channel.ChannelDuplexHandler.connect(ChannelDuplexHandler.java:50)
at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:453)
at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:439)
at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:421)
at io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipeline.java:1024)
at io.netty.channel.AbstractChannel.connect(AbstractChannel.java:203)
at io.netty.bootstrap.Bootstrap.run(Bootstrap.java:167)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:374)
at io.netty.util.concurrent.SingleThreadEventExecutor.run(SingleThreadEventExecutor.java:112)
at java.lang.Thread.run(Unknown Source)
UnresolvedAddressException
表示您用来调用 GetEndpoints 的 URL 或您选择连接的端点内的 URL 具有您的计算机的主机名无法解决。
如果端点中的 URL 与您用于原始呼叫的端点不匹配,并且无法正确配置相关服务器,您可以使用 EndpointUtil 替换EndpointDescription 中的主机名与另一个主机名,在本例中为您用于发现的原始主机名。
我是 opcua 的新手。 我已经尝试了 https://dentrassi.de/2017/09/14/creating-opc-ua-solutions-eclipse-milo/ 中的示例并设法连接到本地 OPCUA 服务器但不是远程服务器。
错误如下所示:
Exception in thread "main" java.util.concurrent.ExecutionException: java.nio.channels.UnresolvedAddressException
at java.util.concurrent.CompletableFuture.reportGet(Unknown Source)
at java.util.concurrent.CompletableFuture.get(Unknown Source)
at com.programcreek.helloworld.test2.main(test2.java:101)
Caused by: java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChannel.java:209)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:207)
at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1279)
at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:453)
at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:439)
at io.netty.channel.ChannelDuplexHandler.connect(ChannelDuplexHandler.java:50)
at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:453)
at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:439)
at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:421)
at io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipeline.java:1024)
at io.netty.channel.AbstractChannel.connect(AbstractChannel.java:203)
at io.netty.bootstrap.Bootstrap.run(Bootstrap.java:167)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:374)
at io.netty.util.concurrent.SingleThreadEventExecutor.run(SingleThreadEventExecutor.java:112)
at java.lang.Thread.run(Unknown Source)
UnresolvedAddressException
表示您用来调用 GetEndpoints 的 URL 或您选择连接的端点内的 URL 具有您的计算机的主机名无法解决。
如果端点中的 URL 与您用于原始呼叫的端点不匹配,并且无法正确配置相关服务器,您可以使用 EndpointUtil 替换EndpointDescription 中的主机名与另一个主机名,在本例中为您用于发现的原始主机名。