ctron / de.dentrassi.camel.milo

This component is now available in Camel 2.19.0
https://camel.apache.org
Apache License 2.0
7 stars 6 forks source link

URISyntaxException without reason? #9

Closed gbrost closed 7 years ago

gbrost commented 7 years ago

Dear Jens,

i tried to connect to an internal OPC-UA Server. My route is defined like this:

      <route id="opctorest">
        <from uri="milo-client:tcp://10.244.192.174:4840/Demo/LEDServer?node=RAW(ns=1;i=1003)&amp;samplingInterval=10000"/>        
        <log message="Triggered Route: opctorest, requesting node 1003: Sensorreading body: ${body}"/>
        <setHeader headerName="CamelHttpMethod">
          <constant>POST</constant>
        </setHeader>
        <log message="Got ${body}"/>
        <to uri="mock:foo"/>
      </route>

The stacktrace i get is this:

2017-02-13 11:08:39,767 | INFO  | duled-executor-0 | SubscriptionManager              | 284 - de.dentrassi.camel.milo.camel-milo - 0.1.1.SNAPSHOT | Starting connect
2017-02-13 11:08:39,830 | INFO  | duled-executor-0 | SubscriptionManager              | 284 - de.dentrassi.camel.milo.camel-milo - 0.1.1.SNAPSHOT | Failed to connect
java.util.concurrent.ExecutionException: UaException: status=Bad_TcpEndpointUrlInvalid, message=java.net.URISyntaxException: Illegal character in authority at index 10: opc.tcp://hostname: Name or service not known:4840/Demo/LEDserver
    at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)[:1.8.0_121]
    at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)[:1.8.0_121]
    at org.apache.camel.component.milo.client.internal.SubscriptionManager.performConnect(SubscriptionManager.java:488)[284:de.dentrassi.camel.milo.camel-milo:0.1.1.SNAPSHOT]
    at org.apache.camel.component.milo.client.internal.SubscriptionManager.connect(SubscriptionManager.java:380)[284:de.dentrassi.camel.milo.camel-milo:0.1.1.SNAPSHOT]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_121]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_121]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
    at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: UaException: status=Bad_TcpEndpointUrlInvalid, message=java.net.URISyntaxException: Illegal character in authority at index 10: opc.tcp://hostname: Name or service not known:4840/Demo/LEDserver
    at org.eclipse.milo.opcua.stack.client.UaTcpStackClient.bootstrap(UaTcpStackClient.java:379)[279:org.eclipse.milo.stack-client:0.1.0]
    at org.eclipse.milo.opcua.stack.client.ClientChannelManager.connect(ClientChannelManager.java:190)[279:org.eclipse.milo.stack-client:0.1.0]
    at org.eclipse.milo.opcua.stack.client.ClientChannelManager.getChannel(ClientChannelManager.java:64)[279:org.eclipse.milo.stack-client:0.1.0]
    at org.eclipse.milo.opcua.stack.client.UaTcpStackClient.sendRequest(UaTcpStackClient.java:126)[279:org.eclipse.milo.stack-client:0.1.0]
    at org.eclipse.milo.opcua.sdk.client.ClientSessionManager.createSession(ClientSessionManager.java:352)[276:org.eclipse.milo.sdk-client:0.1.0]
    at org.eclipse.milo.opcua.sdk.client.ClientSessionManager.getSession(ClientSessionManager.java:147)[276:org.eclipse.milo.sdk-client:0.1.0]
    at org.eclipse.milo.opcua.sdk.client.OpcUaClient.getSession(OpcUaClient.java:546)[276:org.eclipse.milo.sdk-client:0.1.0]
    at org.eclipse.milo.opcua.sdk.client.OpcUaClient.createSubscription(OpcUaClient.java:364)[276:org.eclipse.milo.sdk-client:0.1.0]
    at org.eclipse.milo.opcua.sdk.client.subscriptions.OpcUaSubscriptionManager.createSubscription(OpcUaSubscriptionManager.java:129)[276:org.eclipse.milo.sdk-client:0.1.0]
    at org.eclipse.milo.opcua.sdk.client.subscriptions.OpcUaSubscriptionManager.createSubscription(OpcUaSubscriptionManager.java:111)[276:org.eclipse.milo.sdk-client:0.1.0]
    ... 9 more
Caused by: java.net.URISyntaxException: Illegal character in authority at index 10: opc.tcp://hostname: Name or service not known:4840/Demo/LEDserver
    at java.net.URI$Parser.fail(URI.java:2848)[:1.8.0_121]
    at java.net.URI$Parser.parseAuthority(URI.java:3186)[:1.8.0_121]
    at java.net.URI$Parser.parseHierarchical(URI.java:3097)[:1.8.0_121]
    at java.net.URI$Parser.parse(URI.java:3053)[:1.8.0_121]
    at java.net.URI.<init>(URI.java:588)[:1.8.0_121]
    at org.eclipse.milo.opcua.stack.client.UaTcpStackClient.bootstrap(UaTcpStackClient.java:371)[279:org.eclipse.milo.stack-client:0.1.0]
    ... 18 more

Could you help me to understand what is going on? I tried using the IP address, the full hostname and several different notations. I believe this kind of route already worked in the past. Any help would be appreciated. Thanks!

gbrost commented 7 years ago

Hi,

i guess we have a wrong configuration in one of our OPC-UA Servers. I tried with another one and this was fine. We have another naming scheme there: <from uri="milo-client:tcp://sensordemo-pi-2.host.name.de:4840?node=RAW(ns=2;s=2)&amp;samplingInterval=100000"/> and this works like a charm... I will investigate further.

ctron commented 7 years ago

Ok .. so I will close this one. Feel free to re-open it when necessary.