Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » implementing kura bundle that publishes MQTT messages
implementing kura bundle that publishes MQTT messages [message #1703318] Thu, 30 July 2015 15:21 Go to next message
Sabrina anirbas is currently offline Sabrina anirbasFriend
Messages: 45
Registered: April 2015
Member
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
  • Attachment: Heater.java
    (Size: 8.63KB, Downloaded 144 times)

[Updated on: Fri, 31 July 2015 06:18]

Report message to a moderator

Re: implementing kura bundle that publishes MQTT messages [message #1703396 is a reply to message #1703318] Fri, 31 July 2015 09:31 Go to previous messageGo to next message
Sabrina anirbas is currently offline Sabrina anirbasFriend
Messages: 45
Registered: April 2015
Member
hello,

I forgot to specify the cloud service method in my component xml file as referenced services.
Re: implementing kura bundle that publishes MQTT messages [message #1703461 is a reply to message #1703396] Fri, 31 July 2015 17:24 Go to previous message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hi Sabrina,

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

Dave
Previous Topic:how to change the MQTT messages format?
Next Topic:problem installing Raspbian (Model 2, No Net, with Web UI) - Stable
Goto Forum:
  


Current Time: Thu Apr 25 09:13:40 GMT 2024

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

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

Back to the top