Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » new clone OM2M version (clone on 3.12.2016) not working?
new clone OM2M version (clone on 3.12.2016) not working? [message #1749199] Sat, 03 December 2016 00:24 Go to next message
Son Duong is currently offline Son DuongFriend
Messages: 60
Registered: June 2016
Member
Hello all,

I created an application plugin as followed this tutorial: https://wiki.eclipse.org/OM2M/one/Developer. When run it, I got 5000 Internal error.

What I did was creating an AE called EVALUATE_VALUES and deployed it to the mn-cse node.

And when I see the log files:

[i][INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=1,
from=admin:admin,
resourceType=2,
name=EVALUATE_VALUES,
content=org.eclipse.om2m.commons.resource.AE@4a0468a3,
returnContentType=application/obj,
requestContentType=application/obj,
]
[INFO] - org.eclipse.om2m.core.router.Router
Request handling in the current CSE: null
[INFO] - org.eclipse.om2m.core.router.Router
ResourceController to be used [AEController][/i]

I realized that the log files did not show the to parameter which should be /mn-cse and therefore the Router showed the targetTo parameter in the "Request handling in the current CSE" is null. Therefore the Router didn't know the target address to route the request.

Does anyone have an idea how to fix it?
Thank you so much!
Son

P/s: my createSensorResources() method:
public void createSensorResources(){
		
		String targetId, content;
		targetId = "/" + CSE_ID + "/" + CSE_NAME;
		
		//create application entity
		AE ae = new AE();
		ae.setRequestReachability(true);
		ae.setAppID(ipeId);
		ae.getPointOfAccess().add(ipeId);
		ResponsePrimitive response = RequestSender.createAE(ae, sensorId);
 
		if(response.getResponseStatusCode().equals(ResponseStatusCode.CREATED)){
			targetId = "/" + CSE_ID + "/" + CSE_NAME + "/" + sensorId;
			Container cnt = new Container();
			cnt.setMaxNrOfInstances(BigInteger.valueOf(10));
			// Create the DESCRIPTOR container
			RequestSender.createContainer(targetId, DESCRIPTOR, cnt);
 
			// Create the DATA container
			RequestSender.createContainer(targetId, DATA, cnt);
 
			// Create the description contentInstance
			content = ObixUtil.getSensorDescriptorRep(sensorId, ipeId);
			targetId = "/" + CSE_ID + "/" + CSE_NAME + "/" + sensorId + "/" + DESCRIPTOR;
			ContentInstance cin = new ContentInstance();
			cin.setContent(content);
			cin.setContentInfo(MimeMediaType.OBIX);
			RequestSender.createContentInstance(targetId, cin);
		}
	}



The createResource() method in the RequestSender class:
public static ResponsePrimitive createResource(String targetId, String name, Resource resource, int resourceType){
		RequestPrimitive request = new RequestPrimitive();
		request.setFrom(Constants.ADMIN_REQUESTING_ENTITY);
		request.setTargetId(targetId);
		request.setResourceType(BigInteger.valueOf(resourceType));
		request.setRequestContentType(MimeMediaType.OBJ);
		request.setReturnContentType(MimeMediaType.OBJ);
		request.setContent(resource);
		request.setName(name);
		request.setOperation(Operation.CREATE);
		return CSE.doRequest(request);
	}
 
	public static ResponsePrimitive createAE(AE resource, String name){
		return createResource("/" + Constants.CSE_ID, name, resource, ResourceType.AE);
	}





[Updated on: Sat, 03 December 2016 01:50]

Report message to a moderator

Re: new clone OM2M version not working? [message #1749204 is a reply to message #1749199] Sat, 03 December 2016 01:50 Go to previous messageGo to next message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 227
Registered: November 2013
Senior Member
Hello,
To investigate this issue, try to hard code the uri "/mn-cse" directly on your request instead of reading it fron the config file. Then test again in Linux.

[Updated on: Sat, 03 December 2016 01:52]

Report message to a moderator

Re: new clone OM2M version not working? [message #1749205 is a reply to message #1749204] Sat, 03 December 2016 01:53 Go to previous message
Son Duong is currently offline Son DuongFriend
Messages: 60
Registered: June 2016
Member
Mahdi Ben Alaya wrote on Sat, 03 December 2016 01:50
Hello,
To investigate thus issye, try to hard code the uri "/mn-cse" directly on your request instead of reading it fron the config file. Then test again in Linux.


Hi Mahdi,

I think this problem is now not only happen in Linux, it happens also in windows. therefore I edited my topic
Previous Topic:IPU Monitor
Next Topic:OM2M - Max throughput
Goto Forum:
  


Current Time: Thu Sep 20 08:22:21 GMT 2018

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

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

Back to the top