Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » Erro when running a bundle on Raspberry Pi 2(Missing Constraint: import-Package:org.eclipse.paho.client.mqtt3; version="1.0.1")
Erro when running a bundle on Raspberry Pi 2 [message #1721580] Thu, 28 January 2016 13:34 Go to next message
Saleh Mohd is currently offline Saleh MohdFriend
Messages: 13
Registered: October 2015
Junior Member
Hi everyone,
I am trying to understand Kura and some MQTT technologies. I am using a slightly modified Heater demo program provided inside the Kura framework. Initially, I had no problem running my application both on the Emulator and on the gateway (PI 2). But then I wanted to go one step further using Paho client library to send and receive message to and from a Mosqutto broker residing somewhere in a private cloud. Thats were the problem started. The bundle runs nicely on eclipse Emulator, but when deployed into the the gateway (Raspberry Pi 2) throws the below shown exception.

gogo: BundleException: The bundle "KuraDemo_1.0.0.201601261415 [70]" could not be resolved. Reason: Missing Constraint: Import-Package: org.eclipse.paho.client.mqttv3; version="1.0.1"

Any insight please.

NB: This is another side problem. I cannot open Kura web ui for for the PI. I can ping and ssh the PI nicely. DNS resolution is fine. But whenever I types "http://x.x.x.x:8080/kura", I get 404 http error.

Thanks
Re: Erro when running a bundle on Raspberry Pi 2 [message #1721702 is a reply to message #1721580] Fri, 29 January 2016 10:13 Go to previous messageGo to next message
Said Ucar is currently offline Said UcarFriend
Messages: 56
Registered: June 2015
Member
Hi Saleh,

Welcome to community!

Here is a links that can help you to fix your problem 1;

[1] http://stackoverflow.com/questions/14366421/the-bundle-xyz-could-not-resolved-reason-missing-constraint-import-package-a
[2] https://www.eclipse.org/forums/index.php/t/34402/
[3] https://thecarlhall.wordpress.com/2012/01/19/understanding-the-unresolved-constraint-missing-resource-message-from-apache-felix/
[4] http://stackoverflow.com/questions/1028573/eclipse-rcp-missing-constraint-bundle-error

If you can share you Manifest file and other settings, I think it is more easy to understand problem.

Thanks,
Said
Re: Erro when running a bundle on Raspberry Pi 2 [message #1722740 is a reply to message #1721702] Mon, 08 February 2016 18:26 Go to previous messageGo to next message
Saleh Mohd is currently offline Saleh MohdFriend
Messages: 13
Registered: October 2015
Junior Member
Hi Mustafa,

Thanks for your reply. I have gone through the links you provided but still couldn't solve the problem. I can't get the library org.eclipse.paho.client.mqttv3 packaged in a jar file. Below is the content of my MANIFEST.FM file.

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: A deployable bundle for Pi2
Bundle-SymbolicName: KuraWithPaho
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8,
 JavaSE-1.7
Service-Component: OSGI-INF/component.xml
Import-Package: org.eclipse.kura.cloud;version="1.0.0",
 org.eclipse.kura.configuration;version="1.0.0",
 org.eclipse.kura.message;version="1.0.0",
 org.eclipse.paho.client.mqttv3;version="1.0.1",
 org.eclipse.paho.client.mqttv3.persist;version="1.0.1",
 org.osgi.service.component;version="1.2.0",
 org.slf4j;version="1.6.4"
Bundle-ClassPath: .


Thanks in advance.
Re: Erro when running a bundle on Raspberry Pi 2 [message #1722755 is a reply to message #1722740] Mon, 08 February 2016 21:06 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hi Saleh,

As of Kura v1.3, the Paho client was moved inside the org.eclipse.kura.core bundle. It is no longer exported within the OSGi container. It is recommended to use the DataService or CloudService for accessing the MQTT client. Is there some reason you need to access the Paho client directly?

Thanks,
--Dave
Re: Erro when running a bundle on Raspberry Pi 2 [message #1722767 is a reply to message #1722755] Mon, 08 February 2016 23:14 Go to previous messageGo to next message
Saleh Mohd is currently offline Saleh MohdFriend
Messages: 13
Registered: October 2015
Junior Member
Hi Dave,

Thanks for letting me know that. Actually, there is no specific reason for using Paho client. And, as a matter of fact, I did use CloudService initially and everything worked fine except that the messages received from the MQTT server were encoded, and I couldn't find any documentation on how to decode them. Then, I tried it with Paho client using Eclipse emulator and it was very straight forward both publishing and subscribing. Now I am just experimenting the same thing with Raspberry Pi 2. So is there a way of accessing Paho library from org.eclipse.kura.core bundle within the Kura running on Pi ?

Thanks,
Saleh
Re: Erro when running a bundle on Raspberry Pi 2 [message #1723205 is a reply to message #1722767] Fri, 12 February 2016 13:34 Go to previous message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hi Saleh,

There are two services available for interacting with Paho: CloudService and DataService. As you have noted, the CloudService uses Google Protobuf to encode the MQTT payload. This is done to provide a consistent data model and to reduce the size of the payload. Unfortunately, there is very little documentation on how to decode these messages. I will take this as an action item for the Kura development team. If you are interested, you can see how Kura decodes the messages here [1].

The DataService does not encode the payload and allows more flexibility in the MQTT topics structure. I good reference for this is the Greenhouse demo done by Benjamin Cabe. Here is the publishing section of the project [2].

[1] https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.core.cloud/src/main/java/org/eclipse/kura/core/message/protobuf/KuraPayloadProto.java
[2] https://github.com/kartben/kura-greenhouse-demo/blob/master/org.eclipse.iot.greenhouse.publisher/src/main/java/org/eclipse/iot/greenhouse/publisher/GreenhousePublisher.java

Thanks,
--Dave
Previous Topic:access to kura web ui
Next Topic:UPNP support in Kura
Goto Forum:
  


Current Time: Tue Apr 23 13:52:46 GMT 2024

Powered by FUDForum. Page generated in 0.02773 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top