Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » MQTT notifications not working(NullPointerException when creating new cin that trigger MQTT notification)
MQTT notifications not working [message #1839919] Thu, 01 April 2021 07:39
Jeni Tel is currently offline Jeni TelFriend
Messages: 1
Registered: April 2021
Junior Member
Hello,

I'm currently trying to make MQTT binding works for OM2M v1.4.1, I compiled from sources to add the MQTT package and it seems to works correctly for creating ressources, as i'm receiving response from the IN when creating new ressources.

I'm currently trying to make subscription works but i have a problem when they trigger, there is an error message and no publish is made on the MQTT broker.

Broker : Mosquitto

Error message on the IN console :
Exception in thread "pool-2-thread-3" java.lang.NullPointerException
at org.eclipse.om2m.core.notifier.Notifier$NotificationWorker.run(Notifier.java:296)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Line pointed by the error message in notifier.java :
request.setContent(DataMapperSelector.getDataMapperList().get(sub.getNotificationPayloadContentType()).objToString(notification));



subscription resource (i tried different URI, none works) :
{\"m2m:rqp\" : 
            {\"m2m:fr\":\"admin:admin\"
             ,\"m2m:op\":1,\"m2m:pc\" :
                            {\"m2m:sub\":   
                                     {\"rn\":\"sub_ipe\"
                                      ,\"nu\": \"mqtt://192.16 8.21.237:1883/oneM2M/in-cse/admin:admin/json\"
                                      ,\"nct\":1
                                     }
                            },\"m2m:rqi\":\"m_createAE3567902\"
                             ,\"m2m:to\":\"in-cse/ipe/sub\"
                             ,\"m2m:ty\":23
             }
}


I already tried to modify the "nu", putting
"mqtt://192.168.2 1.237:1883"
or other path to some arbitrary topics.

Content Instance resource ( sent from postman ) :
<m2m:cin xmlns:m2m="http://www.one m2m.org/xml/protocols">

    <cnf>text/plains:0</cnf>

    <con>
           test
    </con>

</m2m:cin>


I have put some spaces in the URL to be able to post.
Can someone help me with this issue ?
Previous Topic:MN-CSE and IN-CSE Authentication
Next Topic:Changing IN-CSE user and password
Goto Forum:
  


Current Time: Sun Oct 06 10:54:35 GMT 2024

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

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

Back to the top