Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » A nullpointerException occur when i send CoAP message to IN-CSE(CoAP, OM2M)
A nullpointerException occur when i send CoAP message to IN-CSE [message #1786274] Sun, 29 April 2018 07:39 Go to next message
soyong kim is currently offline soyong kimFriend
Messages: 4
Registered: April 2018
Junior Member
HI guys.

I tried to send CoAP message to IN-CSE. but IN-CSE printed NullpointerException like the picture i uploaded. I don't know why error appeared...

the source code i uploaded is the sample application to send CoAP message using Californium. this is made by Klemen Petrovcic. how to send the message successfully?
Re: A nullpointerException occur when i send CoAP message to IN-CSE [message #1786376 is a reply to message #1786274] Wed, 02 May 2018 09:46 Go to previous messageGo to next message
Paulo Araújo is currently offline Paulo AraújoFriend
Messages: 8
Registered: March 2017
Junior Member
Hi,
If you reach a conclusion please put it here, I'm with the same problem.
Thanks
Re: A nullpointerException occur when i send CoAP message to IN-CSE [message #1789937 is a reply to message #1786376] Fri, 01 June 2018 02:36 Go to previous message
soyong kim is currently offline soyong kimFriend
Messages: 4
Registered: April 2018
Junior Member
I found another solution to remove the error.

First, I checked the OM2M version released. and I tried to send CoAP message to old version(1.0.0). then It was transferred well without problem. but the latest version had an error. So I compared the two codes.( I focused on CoapServer.java in org.eclipse.om2m.binding.coap)

In Coapserver.java, service() create a requestPrimitive object and transfer to Router.java. and It uses the targetId as a "to" variable in the requestPrimitive object via setTargetId() (setTargetId() calls setTo()) in 1.0.0 version. but In the latest version, it uses the string returned getURI() as a "to" variable in the requestPrimitive object.
(and in the latest version it does not seem to use targetId unless I use it.)

targetId contained "/in-cse" and getURI() returned "coap://localhost/~/in-cse".

The lastest version removed setTargetId() in reqeustPrimitive class. so when I modified setTo(getURI()) to setTo(targetId), it was transferred well.

Is this the bug of the lastest version? or am I doing something wrong?

[Updated on: Fri, 01 June 2018 02:39]

Report message to a moderator

Previous Topic:Using CoAP based applications (Copper vs Erbium)
Next Topic:Reference to request query fields
Goto Forum:
  


Current Time: Fri Nov 01 23:36:35 GMT 2024

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

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

Back to the top