Implementing kura bundle that publishes MQTT messages

Hello,
I am trying to follow this tutorial to develop a bundle that is able to publish MQTT messages :
http://eclipse.github.io/kura/doc/heater_demo.html
but I can't see where it use the setCloudService() method
looking to the source code of the heater example (attached file), can't find where!
starting the bundle without this method causes a null pointure exception (see bellow).
Any idea how to use the cloudServices to publish MQTT messages?
I followed this tuto to configure the cloud client:
http://eclipse.github.io/kura/doc/cloud-configuration.html
Thanks in advance for your help!
Here is the exception:
!STACK 0
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:235)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:347)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:473)
at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:217)
at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:816)
at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:783)
at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
Caused by: java.lang.NullPointerException
at org.eclipse.kura.binding.enocean.EnOcean.activate(EnOcean.java:72)
... 15 more
Root exception:
java.lang.NullPointerException
at org.eclipse.kura.binding.enocean.EnOcean.activate(EnOcean.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:235)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:347)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:473)
at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:217)
at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:816)
at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:783)
at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
Notes:
I don't implement the ConfigurableComponent in my class, should I?
and in the activation method I set m_cloudClient to:
m_cloudClient = m_cloudService.newCloudClient(APP_ID);
the obove line is the one causing the exception
but no previous set to the m_cloudService just a variable declaration

Hi Sabrina,
It sounds like you solved your problem. Let me know if you are having further issues.
Dave

Similar Messages

  • How to change the MQTT messages format?

    Hello,
    the KURA MQTT cloud client publishes messages respecting the following formula:
    #account-name/#client-id/#API-ID/topic
    I want to send MQTT messages with my own format, I dont want to send the account name and the client id in the MQTT message
    how can I do that?
    I already tried to change the configuration in the KURA web interface -> MQTTData transport and I have deleted the content of "lwt.topic" but without success.
    Thanks in advance for your help!

    The following link is an iot-based Greenhouse Application Prototype:
    https://github.com/kartben/kura-greenhouse-demo/blob/master/org.eclipse.iot.greenhouse.publisher/src/main/java/org/eclipse/iot/greenhouse/publisher/GreenhousePublisher.java
    Here, you can see the proper usage of DataService and DataServiceListener to communicate with the Message Broker.
    For, further reading, go through the following links:
    http://download.eclipse.org/kura/releases/1.2.0/docs/apidocs/org/eclipse/kura/data/DataService.html
    http://download.eclipse.org/kura/releases/1.2.0/docs/apidocs/org/eclipse/kura/data/DataServiceListener.html
    Thanks

  • Problems publishing Object Messages

    Hi,
    I create an object message to publish to a topic.
    But that object's class was loaded by a custom classloader (The Application which tries to publish the message was loaded by the system's default primordial classloaders).
    When I try to do this.javax.jms.MessageFormatException Exception is thrown ,since the application's classloader does not know about the class , the custom classloader has loaded.Is there any work around for this.??
    And is there any way i can customize the streams used by any JMS Compliant Messaging System.??
    Regards
    Sathya

    Hi,
    I create an object message to publish to a topic.
    But that object's class was loaded by a custom
    classloader (The Application which tries to publish
    the message was loaded by the system's default
    primordial classloaders).
    When I try to do
    do this.javax.jms.MessageFormatException Exception is
    thrown ,since the application's classloader does not
    know about the class , the custom classloader has
    loaded.Is there any work around for this.??
    And is there any way i can customize the streams
    ms used by any JMS Compliant Messaging System.??
    Regards
    Sathya
    Hi Sathya,
    Not sure what JMS implementation you are using so your customisation question is hard to answer . As for the work around:
    1) you needn't use ObjectMessage to move a serializable object. You could produce a byte[] and pass that through your transport.
    2) Do you really need to pass the whole object by value ? Can you not just pass the information you need to reconstruct the object at the remote end. You could use either Stream or Mapped messages to achieve this.
    Regards
    Paul

  • Re-implement a note that has been reset?

    Hello,
    Can you re-implement a note that has been reset? I am trying to but am getting error message "not all required corrections were implemented".
    I deimplemented the note instead of trying to upload the new version of the note. Now I am stuck without any code correction, and cannot implement the note.
    Thanks for any help!

    Hi Fabienne
    Are you trying with the SNOTE transaction. if yes then try to apply the note manually
    Best Regards
    Naresh

  • OSB 1031: proxy service and publishing JMS messages with no duplicates

    Hi all,
    we have a Web Service proxy that publishes messages into a JMS queue. The queue is persistent and the related connection factory is XA enabled.
    The proxy does the call to the JMS business service from a route node.
    If a failure occurrs after the publishing returns successfully, the caller receives back an error and it will try again to call the web service proxy.
    As the message has been published successfully and was not rollbacked by the proxy, the second call could put on the JMS queue a duplicate message.
    As far as we know only with JMS proxy service, OSB starts a transaction within the pipeline or are we wrong ?
    What do you suggest in order to avoid such a scenario described above ?
    Thanks and regards
    ferp

    Try this link to depict the behavior
    http://allthingsmdw.blogspot.com.au/2012/09/osb-service-callouts-and-oql-part-1.html

  • Publish warning message in SRM ITS

    Hello Friends
    We are implementing SRM 5.0 & want to publish warning message in SRM ITS.
    Could anybody guide me how we can do it for web browser.

    Hello Soumik,
    Do your check - according to your function rule(s) - in method BBP_DOC_CHECK from BAdI BBP_DOC_CHECK_BADI for object type BUS2200.
    Then, populate or not exporting table ET_MESSAGES with blocking or warning message: this message will be displayed at user's bottom screen. 
    Regards.
    Laurent.

  • When I am writing an email, I get an alert message that says "The message could not be copied or moved to the drafts folder. Writing to the folder failed. To ga

    When I am writing an email, I get an alert message that says “The message could not be copied or moved to the drafts folder. Writing to the folder failed. To gain disc space, choose Empty Deleted and choose Compact Folders and try again.”
    If I do that, I get a message saying “There was an error copying to the Sent folder,, retry?”
    If I retry it sends the uncompleted email. All I can do is keep deleting the message and carry on. Then the whole business might repeat itself.
    Help!
    Frank

    Because the location for each song in your library is on your hard drive.  If the hard drive isn't there, how can iTunes play it?
    You'll have to move/copy the music from your hard drive to your computer's hard drive.
    Basically, EASIEST way to do all this, if you don't care about your play counts, etc...
    -Delete EVERYTHING from iTunes, so that your library is now empty.
    -Go to "Advanced" inside of the "Preferences" window, found in the "Edit" drop-down.  You can also access Preferences by pressing Ctrl+, (Press Ctrl and the comma key)
    -Change your iTunes Media Folder Location to something simple, but on your computer. I use C:/iTunes.  Make sure "Keep iTunes Media Folder Organized" and "Copy files to...." are both checked.  You can close Preferences now.
    -Now, drag and drop your music from your hard drive into your iTunes library.  iTunes will automatically add the music to your library, as you would expect, and also creates a copy of each file to place into that iTunes Media Folder you just created.
    Shouldn't have any more problems...

  • I have an IPhone 4 and have no data so I can't receive any iMessages unless I'm on wifi. Is there a way to change it so that all my messages come in as a SMS instead of iMessage?

    I have an IPhone 4 and have no data so I can't receive any iMessages unless I'm on wifi. Is there a way to change it so that all my messages come in as a SMS instead of iMessage?

    Yeah but when Iphone users who send me messages send them in iMessage, it never gets switched to SMS!

  • When i send a text in iMessage the person receiving it gets it from my email address... how do i change that. and in message settings the receiving thing has my email and phone number but my phone number is gray and i can't click on it

    when i send a text in iMessage the person receiving it gets it from my email address... how do i change that. and in message settings the receiving thing has my email and phone number but my phone number is gray and i can't click on it help

    Hello Todd:
    I had this very same problem when trying to activate iMessage and Facetime on my iPad. When I signed into my account, I actually wasn't even presented with the option of a phone number - notwithstanding the fact that I was contacting others (and being reached by others) by my phone number on my iPhone. Having both the iPad and the iPhone on, I kept trying to turn off and on both iMessage and Facebook in Settings on both my iPad and iPhone, hoping that that they would eventually sync. But this proposed solution by others was unsuccessful for me.
    Then, I found out what the problem was: When my iPhone was activated, it automatically registered my phone number for contact purposes. I was using iMessage on my iPhone for quite some time without actually being signed into my Apple ID account. When another device - such as an iPad or iPod - is being used for iMessage or Facebook, you are prompted to sign into your Apple account, using your username and password. These two devices will not register your phone number as an option for contact unless your iPhone is signed into your Apple account as well. In other words: your phone number will not be synced.
    Go into your "Settings" on your iPhone and click on "Messages". Scroll down and click on "Send & Receive" (which should be followed by your phone number). On the next page, you will be able to determine whether or not your iPhone is using the Apple ID for messaging purposes. (Note: This information applies for Facetime as well.) If it is using your Apple ID for messaging, than at the top, you will see "Apple ID: <your particular e-mail account>" in Blue text. However, if you are not using your Apple ID for messaging, than you will see the words: "Use your Apple ID for message". Even though below this you will see your phone number checked as the contact source, you will want to click the tab that says, "Use your Apple ID for message". Sign into your account (just as you must sign in for iMessage on your other devices), and just choose your phone number as the "Send & Receive" contact. (The option of the e-mail will be there too, but you don't have to check it. And later on, you can delete it as an option.)
    Now that all of your devices are signed in using your Apple ID, the other devices should register your phone number as a choice. It may take a little while, however. What I did was sign out of iMessage on my iPad, and then sign in again. If the option didn't appear, I just went back and signed in again, and kept doing this until the option for the phone number appeared.
    Again, this will work for Facetime as well. The solution is to sync your iPhone account with the other devices by using your Apple ID for messaging (and Facetime) purposes.
    I hope that this works for you, Todd!   ~ Brian

  • I've received a message that says my message can't be sent.  Unfortunately, the list of recipients is so long I can't see the bottom to click "try another server".  The message won't scroll.  How can I get to the options at the bottom?

    I've received an error messagae that says my message can't be sent.  Unfortunately, the recipient list is so long I can't see the bottom of the error message to click "Try again" or another option.  The message won't scroll.  How can I get to the bottom of the message?

    Many Thanks, Kurt.
    I knew I'd seen the solution you've provided somewhere - either in MacWorld or MacFormat - but couldn't remember the Gatekeeper bit!
    I shall save it somewhere VERY safe now in case this happens again …
    You have made an old man very happy and saved me from worrying that senile decay had suddenly set in. (I was 70 last week so you might understand the situation from that.)
    Best wishes
    OllyanDinah

  • HT3910 Original OSX 10.5.6 and app dvd's (that came w/MBP) lost,and have recv'd replacement dvd from Apple. Once hard drive is erased and new OS w/dvd instl'd, how do I insure all applications bundle - that came with MBP - will reinstall?

    Original OSX 10.5.6 and app dvd's (that came w/MBP) lost,and have recv'd replacement dvd from Apple. Once hard drive is erased and new OS w/dvd instl'd, how do I insure all applications bundle - that came with MBP - will reinstall?

    Your profile says you have 10.6, so why bother with the original 10.5 OS?
    But to your question, before you erase anything, make a backup of your data for safe keeping and restoration. Having an external hard drive for this purpose is most useful.

  • "Unknown Publisher" error message during installation

    Ok, I have tried for several days and even got ahold of Microsoft on this issue. Every time i go to download Itunes the download is ok, but when it goes to install Itunes, I ALWAYS get "Unknown Publisher" error message and installation is cancelled. How do i resolve this issue? Any ideas?????

    Welcome to AD!
    Some folks have had success by downloading and installing QuickTime standalone, then installing itunes after QT. iTunes needs QT codecs to play audio & video.
    http://www.apple.com/quicktime/download/
    Make sure to get the version withOUT itunes.

  • I have created PDF from hardcopy by using my scanner. After I run OCR option for my PDF by using Acrobat Pro 9. But "Text-to-speech" functionality of the PDF says that an error message comes up that says the page is empty when I turns on the read out loud

    I have created PDF from hardcopy by using my scanner. After I run OCR option for my PDF by using Acrobat Pro 9. But "Text-to-speech" functionality of the PDF says that an error message comes up that says the page is empty when I turns on the read out loud option in Acrobat. Kindly help me to sortout this problems?

    So I tried generating the same PDFs on two other computers that have Acrobat 9 Pro.  Results were reproduced.  The verdict is:
    - complex PDF files (that is, containing cross-references, tables of contents, and bookmarks) generated by Acrobat 9.x Pro are roughly 2-5x larger than the identical file generated with Acrobat 8.x Pro.
    - different PDF conversion settings make a negligable difference (less than 10% rather than 70-80%).
    - using the "Reduce File Size" or "Optimize PDF" option cuts the file size roughly in half, almost always resulting in a "image downsampling mask" warning message, which requires acknowledgement (that is a problem for batch processing or automation).
    - adding an Acrobat watermark to the file cuts the file size roughly in half.
    - just using Save As to another filename has no effect on file size.
    - generating the PDF in Acrobat 9 with links but no PDF bookmarks still results in the inflated file size.
    - generating the PDF in Acrobat 9 without any links or bookmarks results in approximately the same file size as the Acrobat 8 PDF with full links and bookmarks.
    It appears that Acrobat 9's manner of adding links is what's bloating  the files, and in my case it's probably not related to images or image resolution/print quality.  It's a shame, because Acrobat 9 seems to have made some  improvements to the Review Tracker interface, and a few other bells and  whistles which I haven't really gotten around to exporing yet.  But  unless I find a way to keep my links and the PDF file sizes comparable to what I was  getting with Acrobat 8 Pro, it looks like I'm going to stay with Acrobat 8.

  • Image colors depend on the computer that publishes my Domain file?!?!

    Here's a weird one... First, the setup.
    My site is published from two different computers both using iWeb '08, using the same Domain.sites2 file that's passed from computer to computer using my idisk. The Domain file is always copied down to a local computer before new changes are made and published. Recently, I've noticed, that publishing from one of the computers (but not the other) results in overly intense colors, especially in the red tones. This I tested by accessing my site with Safari and opening one of the overly intense images. Leaving the browser page open, I then republish my site using a different computer, accessed the page again... and the images is normal! On screen you see the previously published image beside the newly published image, and the color deffirecenes are obvious, even though the same file was being published without modification.
    Can anyone think of why this is happening? I can't imagine iWeb treating the publishing of images differently from computer to computer, unless there is some other weird computer-dependent processing going on.
    Thanks for any ideas!
    John
    aking the same Domain file, and without replacing the

    Unfortunately, the issue is not with which pages get published (that works fine), but with the amount of color in the images that are published.
    Imagine this...
    You have a JPEG photo of a sunset that is stored on an idisk. The photo is downloaded to Computer A, placed onto a page in iWeb, and published to the web. Here, the photo appears on the web site as one would expect (blue sky, subtle oranges and reds, some purples). The Domain.sites2 file is then copied onto the idisk.
    Now, on Computer B the Domain.sites2 is downloaded from the idisk, and opened in iWeb. A change is made to the page (not a change to the photo) and the site is republished. When visiting the site a sunset still appears, but the blue sky is now really, really blue, and the subtle oranges and reds are now intensely red. It would appear that a significant amount of contrast and saturation has been added to the photo.
    Something about publishing is different on Computer B.
    Here's some additional interesting data.
    The original photo file is 1024 x 656 pixels and 391K in size.
    The photo is sized in iWeb to be 605 x 388.
    After the initial publishing from Computer A (the one in which the image looks fine), and upon investigating the Site folder created on MobileMe, the photo file has been resized to be 605 x 388 and now occupies 108K. After publishing from Computer B (where the image is contrasty and oversaturated), the dimensions of the file are still 605 x 388, but the size of the file when published from Computer B is 111K, so the file as published from Computer B is clearly different.
    I'm guessing that this has something to do with how iWeb treats rescaling an image on one computer (or, maybe, version of Mac OS X or Quicktime?!?!) to another.
    Does this sound familiar to anyone?
    Thanks!
    John

  • How can I get rid of 14 e-mails that say "This message has no content."

    How can I get rid of 14 emails on my iPad Touch that say, "This message has no content."  Since I can't open them, neither can I delete them.

    - Try resetting the iPod:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Can you delete them if you access them on another device?

Maybe you are looking for