Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » CoAP between App and in-cse(Problem in CoAP App)
CoAP between App and in-cse [message #1786310] Mon, 30 April 2018 14:54 Go to next message
Paulo Araújo is currently offline Paulo AraújoFriend
Messages: 8
Registered: March 2017
Junior Member
Using an example that I found here on the forum, I tried to link my Coap Java application with the in-cse server.
My in-cse "config.ini" file is like this:

org.eclipse.equinox.http.jetty.http.port=8080
org.eclipse.om2m.cseBaseAddress=127.0.0.1
org.eclipse.om2m.cseBaseName=in-name
org.eclipse.om2m.cseBaseId=in-cse
org.eclipse.om2m.adminRequestingEntity=admin\:admin
org.eclipse.om2m.cseType=IN
org.eclipse.om2m.coap.port=5682
org.eclipse.om2m.cseBaseProtocol.default=http //tried with both http and coap here

And my app uses the function (complete class already posted by the author here in the forum somewhere):

public static Request returnCreateAEString(String AEname){

String createApplicationBody = "<om2m:ae xmlns:om2m=\"http://www.onem2m.org/xml/protocols\" rn=\""+AEname+"\">" +
"<api>app-sensor</api>" +
"<lbl>Type/sensor Category/temperature Location/home</lbl>" +
"<rr>true</rr>" +
"</om2m:ae>";
Request createApplication = new Request(Code.POST);
createApplication.getOptions()
.setContentFormat(MediaTypeRegistry.APPLICATION_XML)
.setAccept(MediaTypeRegistry.APPLICATION_XML)
.addOption(new Option(256, "admin:admin"))
.addOption(new Option(267, 2));
createApplication.setPayload(String.valueOf(createApplicationBody));
return createApplication;
}

And in my main class:
performOperation(returnCreateAEString(tempName), "coap://127.0.0.1:5682/~/in-cse");

The problem is that i receive the following error on the server side:
Received request in Router: RequestPrimitive [operation=1,
to=coap://localhost:5682/~/in-cse,
from=admin:admin,
resourceType=2,
content=<om2m:ae xmlns:om2m="http://www.onem2m.org/xml/protocols" rn="MY_SENSOR"><api>app-sensor</api><lbl>Type/sensor Category/temperature Location/home</lbl><rr>true</rr></om2m:ae>,
returnContentType=application/xml,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.core.router.Router
Request targeting another CSE, forwarding to Redirector: /in-cse/coap://localhost:5682/~/in-cse
[INFO] - org.eclipse.om2m.core.redirector.Redirector
Unknow CSE, sending request to registrar CSE: in-cse
java.lang.NullPointerException


Re: CoAP between App and in-cse [message #1786983 is a reply to message #1786310] Wed, 16 May 2018 19:10 Go to previous message
Paulo Araújo is currently offline Paulo AraújoFriend
Messages: 8
Registered: March 2017
Junior Member
I managed to solve the problem with the release 1.0.0, available here: https://wiki.eclipse.org/OM2M/Download
No other version worked.
Previous Topic:monitor on python or monitor.jar source code or explanation
Next Topic:JSON content "con" attribute in ContentInstance
Goto Forum:
  


Current Time: Tue Nov 20 00:31:15 GMT 2018

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

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

Back to the top