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

Missing dependency #4

Closed gbrost closed 7 years ago

gbrost commented 7 years ago

Hi, i mentioned this in a comment of an already closed issue, but i guess it is an independent one.

I had problems deploying the camel endpoint and got this error: Caused by: org.osgi.framework.BundleException: Unable to resolve de.dentrassi.camel.milo.camel-milo [158](R 158.0): missing requirement [de.dentrassi.camel.milo.camel-milo [158](R 158.0)] osgi.wiring.package; (&(osgi.wiring.package=com.google.common.base)(version>=19.0.0)(!(version>=20.0.0))) Unresolved requirements: [[de.dentrassi.camel.milo.camel-milo [158](R 158.0)] osgi.wiring.package; (&(osgi.wiring.package=com.google.common.base)(version>=19.0.0)(!(version>=20.0.0)))

I fixed this by adding this dependecy to the pom.xml

<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>19.0</version>
</dependency>

Best regards Gerd

ctron commented 7 years ago

Thanks for reporting this. To which pom file did you add this dependency?

gbrost commented 7 years ago

I added it to the project’s master pom: https://github.com/ctron/de.dentrassi.camel.milo/blob/master/pom.xml

If this is ok, I can commit and push the change.

From: Jens Reimann [mailto:notifications@github.com] Sent: Mittwoch, 30. November 2016 12:22 To: ctron/de.dentrassi.camel.milo de.dentrassi.camel.milo@noreply.github.com Cc: Brost, Gerd gerd.brost@aisec.fraunhofer.de; Author author@noreply.github.com Subject: Re: [ctron/de.dentrassi.camel.milo] Missing dependency (#4)

Thanks for reporting this. To which pom file did you add this dependency?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ctron/de.dentrassi.camel.milo/issues/4#issuecomment-263849612, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHB-iu75Mdg6TRjuhJ9AXxJOIsrP_xKoks5rDVxIgaJpZM4K_7ES.

gbrost commented 7 years ago

Hi Jens,

maybe i could ask you another thing: Now that i got my Endpoint running, i still have problems to get a working OPC connection. I use this endpoint URI, pretty similar to yours in the tests:

Now i always got an error in my server. Taking a look at the communication with Wireshark reveals that the client is trying to do "write" requests on the specified node. I guessed the default would be "read requests" and i guess that was also intended in your test routes. Could you help me understand the correct behaviour?

Thanks Gerd

ctron commented 7 years ago

Well if you configuring a "to" then this will result in a write request. Reading should be "from".

ctron commented 7 years ago

I don't see how guava should be missing. It is a transitive dependency which is also defined in the karaf feature file. How did you install the milo component?

gbrost commented 7 years ago

I just built milo and camel-milo and installed the .kar with kar:install, as described in the README. We have a karaf assembly we build ourselves, so maybe the problem lies there. I built your adapter without having guava in the pom.xml and it still shows up in feature.xml. So you are right, this should be fine. The guava bundle is not installed, however. It must be our karaf then i guess. Can i do anything else?

Regarding my route, i posted it out of context. I wanted to create a timer based route:

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route id="opctorest">
        <from uri="timer://simpleTimer?period=1000"/>
        <log message="Triggered Route: opctorest: Sensorreading body: ${body}"/>
        <to uri="milo-client:tcp://0.0.0.0:4840/freeopcua/server?nodeId=2&amp;namespaceUri=http://examples.freeopcua.github.io"/>        
        <convertBodyTo type="java.lang.String"/>        
        <to uri="stream:out"/>
      </route>
    </camelContext>

And i thought, based on some route examples out there, that it would turn the "from" to a "to". So i guessed wrong... Is there a way to do this? Thanks!

ctron commented 7 years ago

Ok. The KAR doesn't contain dependencies. So you need to install those manually or in a different way.

ctron commented 7 years ago

Well what your route does is to send "nothing" (since the timer does not set a body) to the milo-client component, which triggers a write towards the server.

You simply need a "from" without a timer, since milo and OPC UA are event based and don't to polling.

If you look in [1], You can find a parameter called "samplingInterval" , which will ask the OPC UA server (and maybe it backing communication stack) on how frequently information should be updated.

[1] https://github.com/ctron/de.dentrassi.camel.milo/blob/master/camel-milo/src/main/docs/milo-client.adoc

gbrost commented 7 years ago

I see. Is there another "recommended" way to deploy it with dependencies?

gbrost commented 7 years ago

Thank you, rewriting the route did the trick and my server replies. The only thing that does not match: Our model seems to define numeric node ids. Then my route connects, it queries a string based node id. Is it possible to specify that i am querying a numeric node id?

ctron commented 7 years ago

Yes, there should be a release of Milo soon. So you can just grab everything from Maven Central.

Not at the moment.

gbrost commented 7 years ago

Ok, thank you very much! For now I am totally happy with manual deployment.

From: Jens Reimann [mailto:notifications@github.com] Sent: Freitag, 2. Dezember 2016 09:18 To: ctron/de.dentrassi.camel.milo de.dentrassi.camel.milo@noreply.github.com Cc: Brost, Gerd gerd.brost@aisec.fraunhofer.de; Author author@noreply.github.com Subject: Re: [ctron/de.dentrassi.camel.milo] Missing dependency (#4)

Yes, there should be a release of Milo soon. So you can just grab everything from Maven Central.

Not at the moment.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ctron/de.dentrassi.camel.milo/issues/4#issuecomment-264398462, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHB-ijaVSzDyfFySPXinqSzC8gEBVbDYks5rD9RHgaJpZM4K_7ES.

ctron commented 7 years ago

Cool.

gbrost commented 7 years ago

Could you give me a hand getting around the string vs numeric node id problem? Can i somehow specify what values i pass into the server? As i wrote above, our model specifies numeric node ids, but when i connect with my route, it automatically queries string based node IDs. So when i specify nodeId=1, it queries for the string "1" and does not find the node. Thanks!