|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
| soyong kim
Registered: April 2018
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
Powered by FUDForum
. Page generated in 0.01812 seconds