Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] Question to Milo OPC UA Client

Hello Simon,
Is your server being hosted in a virtual machine by any chance?  I observe a similar issue when connecting to the UaExpert ANSI C demo server hosted on Microsoft Azure.  The Unified Automation client application can connect just fine, but the Milo OpcUaClient's connect() method throws an UnresolvedAddressException.  The reason is that the public IPv4 address (104.42.40.127 in my case) is not the same as the VM machine name (Point85 in my case).  After getting the EndpointDescriptions back from the server and choosing the anonymous endpoint, the public IP address has been substituted with the machine name.  This causes the UnresolvedAddressException.

Below is a short log:

2018-05-28 09:53:26.422 INFO  UaOpcClient - Connecting to: opc.tcp://104.42.40.127:48020
2018-05-28 09:53:26.437 INFO  UaOpcClient - Identity provider: AnonymousProvider
2018-05-28 09:53:32.075 INFO  UaOpcClient - Configured policy: http://opcfoundation.org/UA/SecurityPolicy#None, mode: None
2018-05-28 09:53:32.075 INFO  UaOpcClient - Checking URL: opc.tcp://Point85:48020,  Policy: http://opcfoundation.org/UA/SecurityPolicy#None, Mode: None
2018-05-28 09:53:32.110 INFO  UaOpcClient - Using endpoint: opc.tcp://Point85:48020 [http://opcfoundation.org/UA/SecurityPolicy#None, None]
2018-05-28 09:53:32.152 INFO  UaOpcClient - App name: Point85 OEE OPC UA Client, app URI: urn:point85:oee:client
java.util.concurrent.ExecutionException: java.nio.channels.UnresolvedAddressException
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
at org.point85.domain.opc.ua.UaOpcClient.connect(UaOpcClient.java:232)
at org.point85.app.opc.ua.OpcUaController.connectToDataSource(OpcUaController.java:38)
at org.point85.app.designer.DataSourceConnectionController$ConnectionService$1.call(DataSourceConnectionController.java:147)
at org.point85.app.designer.DataSourceConnectionController$ConnectionService$1.call(DataSourceConnectionController.java:1)
at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javafx.concurrent.Service.lambda$null$493(Service.java:725)
at java.security.AccessController.doPrivileged(Native Method)
at javafx.concurrent.Service.lambda$executeTask$494(Service.java:724)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

On Mon, May 28, 2018 at 3:05 AM, Jens Reimann <jreimann@xxxxxxxxxx> wrote:
Hi Simon,

UnresolvedAddressException indicates that the client cannot resolve the hostname.

This may be due to the fact that your server reports an unresolveable hostname. You may replace that when choosing the endpoint.

Cheers

Jens


On Mon, May 28, 2018 at 11:24 AM, Simon Felderer <simon-felderer@xxxxxxxxxx> wrote:
Hey Jens,

I still cannot connect to the server.. Even though I have another visual Tool to connect to opc ua server and there I can do it with the same port and IP adress…..
I always get that error..

Wait for completion
Failed to connect
java.util.concurrent.CompletionException: java.nio.channels.UnresolvedAddressException
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:769)
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736)
at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Net.java:101)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:622)
at io.netty.util.internal.SocketUtils$3.run(SocketUtils.java:83)
at io.netty.util.internal.SocketUtils$3.run(SocketUtils.java:80)
at java.security.AccessController.doPrivileged(Native Method)
at io.netty.util.internal.SocketUtils.connect(SocketUtils.java:80)
at io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChannel.java:210)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:205)
at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1234)
at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:539)
at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:524)
at io.netty.channel.ChannelDuplexHandler.connect(ChannelDuplexHandler.java:50)
at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:539)
at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:524)
at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:506)
at io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipeline.java:978)
at io.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)
at io.netty.bootstrap.Bootstrap$2.run(Bootstrap.java:166)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:399)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:464)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
at java.lang.Thread.run(Thread.java:748)


Am 24.05.2018 um 17:17 schrieb Simon Felderer <simon-felderer@xxxxxxxxxx>:

Thank you a lot.. Got it running now.
It was an Eclipse intern problem. Probably because I had too many run configurations open.

Cheers


Am 24.05.2018 um 15:19 schrieb Jens Reimann <jreimann@xxxxxxxxxx>:

So it looks like you are missing the "pom.xml" file. Maybe you are in the wrong directory when you start? All commands in the howto document should be started from the root of repository.



On Thu, May 24, 2018 at 3:03 PM, Simon Felderer <simon-felderer@xxxxxxxxxx> wrote:
No it doesnt work either..
I get these error list

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM /Users/simon/client-examples/pom.xml: /Users/simon/client-examples/pom.xml (No such file or directory) @
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project  (/Users/simon/client-examples/pom.xml) has 1 error
[ERROR]     Non-readable POM /Users/simon/client-examples/pom.xml: /Users/simon/client-examples/pom.xml (No such file or directory)
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:




Am 24.05.2018 um 14:58 schrieb Jens Reimann <jreimann@xxxxxxxxxx>:

So, does it work when you start if from the command line? I agree that it also should work from the IDE, but maybe that is a second step.

On Thu, May 24, 2018 at 2:54 PM, Simon Felderer <simon-felderer@xxxxxxxxxx> wrote:
Well I import it to my IDE (Eclipse Oxygen 3a), 
go to connection file click run as and implement the right class and then start it.. 
I have Maven also installed before so it should actually work..
Is there something I forgot? 




Am 24.05.2018 um 14:46 schrieb Jens Reimann <jreimann@xxxxxxxxxx>:

So how do you run it?

When I run it like described in the how to, it works for me.

On Thu, May 24, 2018 at 2:41 PM, Simon Felderer <simon-felderer@xxxxxxxxxx> wrote:
Hi Jens,

 I tried to load your example. It looks pretty nice to me until now.. very good!
I am just having a problem now when running it and I dont know how to fix it. 
When I try to run the Connection file, there comes to problem Error: Main Class de.dentrassi…..Connect could not be find or loaded..
I tried many things but couldnt fix it.. Do you already had the problem? 

I didnt change anything of the project only the IP Adress of my Server..
Ah yea I am trying to run the Client Example…

Thanks a lot!

Best regards
Simon Felderer

Am 24.05.2018 um 11:41 schrieb Jens Reimann <jreimann@xxxxxxxxxx>:

Hi Simon,

here is the repository of my talk from last year's EclipseCon: https://github.com/ctron/milo-ece2017

That contains all kinds of examples and might get you started. However this is using Milo 0.1.3 … so with Milo 0.2.x things might look bit different.

Cheers

Jens

On Thu, May 24, 2018 at 11:38 AM, Simon Felderer <simon-felderer@xxxxxxxxxx> wrote:
Hello,

I am trying to read Variables from my running PLC, but i still did not got how the example are structured because there is not much documentation about it, I am also pretty new to OPC UA.
So, if I just want to read the value of these stuff for example do I need the ReadExample or the Subscription Example.?
And how do I preference what I exactly want to read, I mean where can I ask for the NodelID I want to have displayed and with which Example can I do it?
Thank you a lot!!


Best regards,
Simon Felderer
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev



--
Jens Reimann
Senior Software Engineer / EMEA ENG Middleware
Werner-von-Siemens-Ring 14
85630 Grasbrunn
Germany
phone: +49 89 2050 71286
_____________________________________________________________________________

Red Hat GmbH, www.de.redhat.com,
Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham, Michael O'Neill
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev


_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev




--
Jens Reimann
Senior Software Engineer / EMEA ENG Middleware
Werner-von-Siemens-Ring 14
85630 Grasbrunn
Germany
phone: +49 89 2050 71286
_____________________________________________________________________________

Red Hat GmbH, www.de.redhat.com,
Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham, Michael O'Neill
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev


_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev




--
Jens Reimann
Senior Software Engineer / EMEA ENG Middleware
Werner-von-Siemens-Ring 14
85630 Grasbrunn
Germany
phone: +49 89 2050 71286
_____________________________________________________________________________

Red Hat GmbH, www.de.redhat.com,
Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham, Michael O'Neill
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev


_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev




--
Jens Reimann
Senior Software Engineer / EMEA ENG Middleware
Werner-von-Siemens-Ring 14
85630 Grasbrunn
Germany
phone: +49 89 2050 71286
_____________________________________________________________________________

Red Hat GmbH, www.de.redhat.com,
Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham, Michael O'Neill
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev

_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev


_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev




--
Jens Reimann
Senior Software Engineer / EMEA ENG Middleware
Werner-von-Siemens-Ring 14
85630 Grasbrunn
Germany
phone: +49 89 2050 71286
_____________________________________________________________________________

Red Hat GmbH, www.de.redhat.com,
Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham, Michael O'Neill

_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev



Back to the top