Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Today's Messages (on)  | Unanswered Messages (off)

Forum: TMF (Xtext)
 Topic: Serializing cross-references with Serializer2
Re: Serializing cross-references with Serializer2 [message #1739112 is a reply to message #1739097] Wed, 27 July 2016 15:00
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 135
Registered: March 2011
Senior Member
I realized why the breakpoints were never reached. Serialization fails much earlier, namely when executing org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.createSequence(ISerializationContext, EObject) on the top-level node of the model. Apparently in this line:

List<TraceItem> trace = new NfaUtil().backtrack(nfa, co, new NfaUtil.BacktrackHandler<ISemState, TraceItem>() {

trace ends up being null.

So it's the BacktrackHandler that fails.

Is there any documentation anywhere on this?

What could make this backtracking fail? Any particular grammar pattern could cause it to fail?





Re: Serializing cross-references with Serializer2 [message #1739115 is a reply to message #1739097] Wed, 27 July 2016 15:07
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 9336
Registered: July 2009
Senior Member
from this message i dont see where the cross ref serializer is involved

Model:
	greetings+=Greeting*;
	
Greeting:
	'Hello' name=ID ('from' from=[Greeting])?'!';


public class MyDslCRS extends CrossReferenceSerializer {
	
	@Override
	public boolean isValid(EObject semanticObject, CrossReference crossref, EObject target, INode node,
			Acceptor errors) {
		System.out.println("isValid");
		return super.isValid(semanticObject, crossref, target, node, errors);
	}
	
	@Override
	public String serializeCrossRef(EObject semanticObject, CrossReference crossref, EObject target, INode node,
			Acceptor errors) {
		System.out.println("serialize");
		return super.serializeCrossRef(semanticObject, crossref, target, node, errors);
	}

}


class MyDslRuntimeModule extends AbstractMyDslRuntimeModule {
	
	def Class<? extends ICrossReferenceSerializer> bindICrossReferenceSerializer() {
		MyDslCRS
	}
}


class Main {
	
	def static void main(String[] args) {
		val i = new MyDslStandaloneSetup().createInjectorAndDoEMFRegistration
		val rs = i.getInstance(ResourceSet)
		val r = rs.createResource(URI.createURI("demo.mydsl2"))
		val model = MyDslFactory.eINSTANCE.createModel => [
			val g1 = MyDslFactory.eINSTANCE.createGreeting => [
				name = "g1"
			]
			val g2 = MyDslFactory.eINSTANCE.createGreeting => [
				name = "g2"
				from = g1
			]
			greetings += g1
			greetings += g2
		]
		r.contents += model
		r.save(SaveOptions.defaultOptions.toOptionsMap)
	}
	
}


the value aboout the resource comes from ???
XMLSaveImpl does not sound like eclipse? sure you did not acidentally called standaloensetup from eclipse?

then it would be interesting: is this called from eclipse or is this called from standalone.
if from eclipse did you use LiveScopeResourceSetInitializer to init your resourceset


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: Serializing cross-references with Serializer2 [message #1739118 is a reply to message #1739115] Wed, 27 July 2016 15:17
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 135
Registered: March 2011
Senior Member
Sorry, I think we got messages posted at the same time.

Yes, the XMLSaveImpl was misleading. I forgot I was serializing the model as an XML resource before invoking the serialization on the XtextResource.

Nevertheless, ignoring that, I still have a problem, as explained in my last message:

The failure occurs very early, in org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.createSequence(ISerializationContext, EObject), when the EObject is the root element of the model, and it is caused because the call

List<TraceItem> trace = new NfaUtil().backtrack(nfa, co, new NfaUtil.BacktrackHandler<ISemState, TraceItem>() ...

returns null.

So I was wondering if there is a particular pattern in a grammar that makes this backtracking fail, or if there was a description somewhere about this backtracking mechanism in serialization, so I can figure it out.

Thanks
Re: Serializing cross-references with Serializer2 [message #1739120 is a reply to message #1739118] Wed, 27 July 2016 15:27
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 9336
Registered: July 2009
Senior Member
sry i have no idea on this. can you try to create a minimal reproducing grammar?

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: Serializing cross-references with Serializer2 [message #1739124 is a reply to message #1739120] Wed, 27 July 2016 15:43
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 135
Registered: March 2011
Senior Member
Ok, I'll try to create a minimal example, but isn't there any documentation on how the serializer works?

Thanks
Re: Serializing cross-references with Serializer2 [message #1739136 is a reply to message #1739124] Wed, 27 July 2016 16:07
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 9336
Registered: July 2009
Senior Member
no docs that i would know of sry

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Forum: Newcomers
 Topic: Problem with Run New Configuration
Re: Problem with Run New Configuration [message #1739032 is a reply to message #1739017] Wed, 27 July 2016 05:31
Ed Merks is currently offline Ed MerksFriend
Messages: 27707
Registered: July 2009
Senior Member
You're looking in External Tools Configurations... You want to be
looking at the Run or Debug configurations. (Run -> Run Configurations
or the toolbar button with the green "start arrow" without the red
toolbox on it.


On 27.07.2016 01:35, Stefan Stefanov wrote:
> Hi,
>
> I am new to eclipse and in the beginning all my java applications run just fine, but after i clicked here (please see the screenshot No1) I have lost my default program run configurations and now i don't know what to do to restore them.
> I have read all around and didn't find a solution. Please tell me what should I do (see screenshot No2) to restore the default run configurations.
>
> Thank you in advance.
> Stefan Stefanov
>
 Topic: Anyone running XMLEspresso on Neon
Re: Anyone running XMLEspresso on Neon [message #1739045 is a reply to message #1739021] Wed, 27 July 2016 08:22
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2700
Registered: July 2009
Senior Member

I'm not sure why you're so determined to use this editor, but you might try contacting them through their web site as well.

Nitin Dahyabhai
Eclipse WTP
IBM Emerging Technologies
 Topic: Command to clean workspace
Command to clean workspace [message #1739074] Wed, 27 July 2016 11:51
Hamid Ehyaei is currently offline Hamid EhyaeiFriend
Messages: 1
Registered: July 2016
Junior Member
I know that I can start eclipse with a certain workspace by the following command:
> eclipse -data "WorkspacePath"
Now I want a command to clean the workspace: all projects imported and all perspectives showing.
Plaese help me.
 Topic: Need download link to org.eclipse.equinox.launcher.gtk.linux.s390_1.1.1.R36x_v20110125.jar
Need download link to org.eclipse.equinox.launcher.gtk.linux.s390_1.1.1.R36x_v20110125.jar [message #1739078] Wed, 27 July 2016 12:14
Vasiullah Mujawar is currently offline Vasiullah MujawarFriend
Messages: 1
Registered: July 2016
Junior Member
I need the download link to org.eclipse.equinox.launcher.gtk.linux.s390_1.1.1.R36x_v20110125.jar.

OR

the download link to the IBM z System equivalent of
org.eclipse.equinox.launcher.gtk.linux.x86_1.1.2.R36x_v20101019_1345
 Topic: Eclipse newbie
Eclipse newbie [message #1739140] Wed, 27 July 2016 16:54
David Simpson is currently offline David SimpsonFriend
Messages: 1
Registered: July 2016
Junior Member
I'm an Eclipse newbie. I also have Netbeans installed. I downloaded & installed Intellij but I found it confusing so I uninstalled it. So, I'm going to experiment with both IDEs & choose which one I prefer.

I have a Mac. I downloaded & installed Xcode & tried out Swift. I also watched YouTube videos on how to create GUIs in Swift. Swift is fine if you don't want to create GUIs, but it's verbose if you want to create GUIs.

I want to be able to create a program on my Mac & "export" it to run on Windows.

It appears that you have more than one IDE. I'm intrigued that more than one language can run in a Java VM. I'd like to learn Jython & perhaps Groovy & Scala. Which Eclipse IDE do I use to create Java & Jython, Groovy & Scala programs?
Forum: OM2M
 Topic: Source code for OM2M v0.8
Source code for OM2M v0.8 [message #1739051] Wed, 27 July 2016 09:06
Trung Luu is currently offline Trung LuuFriend
Messages: 22
Registered: June 2016
Junior Member
Hi all,
I want to ask that is it possible to get the source code of OM2M version 0.8 and how can I get it ? Thanks in advanced!
Re: Source code for OM2M v0.8 [message #1739053 is a reply to message #1739051] Wed, 27 July 2016 09:07
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 173
Registered: November 2013
Senior Member
Hi,
You can find it under the branch "smart" on our git repository.
Re: Source code for OM2M v0.8 [message #1739079 is a reply to message #1739053] Wed, 27 July 2016 12:30
Trung Luu is currently offline Trung LuuFriend
Messages: 22
Registered: June 2016
Junior Member
Hi Mahdi,
Thanks for your quick response.
 Topic: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739050 is a reply to message #1739001] Wed, 27 July 2016 09:04
Can LIU is currently offline Can LIUFriend
Messages: 22
Registered: May 2016
Junior Member
Hi Mahdi,

Thanks a lot for your quick response.
I've changed the nu to "/in-cse/in-name/MY_AEGPS" but it still not working.
In order to look cleaner, I just keep the IN-AE(MY_AEGPS) and one subscription (sub_MY_GPS).

massage received in IN:
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Built RequestPrimitive: RequestPrimitive [to=/in-cse/in-name/MY_AEGPS,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_593932143">
<ty>4</ty>
<ri>/mn-cse/cin-593932143</ri>
<pi>/mn-cse/cnt-451289210</pi>
<ct>20160727T083543</ct>
<lt>20160727T083543</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>121</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8703106667,2.307406&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Content type headers: application/xml
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Header value: application/xml
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Accept header: application/xml
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=5,
to=/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_593932143">
<ty>4</ty>
<ri>/mn-cse/cin-593932143</ri>
<pi>/mn-cse/cnt-451289210</pi>
<ct>20160727T083543</ct>
<lt>20160727T083543</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>121</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8703106667,2.307406&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
queryStrings={}]
[INFO] - org.eclipse.om2m.core.router.Router
Request handling in the current CSE: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.router.Router
OM2M exception caught in Router: Unknown or unauthorized originator
[INFO] - org.eclipse.om2m.core.router.Router
Response in Router= ResponsePrimitive [responseStatusCode=4103,
content=Unknown or unauthorized originator,
to=/mn-cse,
from=/in-cse,
contentType=text/plain,
]




And the massage received in MN:


[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=1,
to=/mn-cse/mn-name/MY_GPS/DATA,
from=admin:admin,
resourceType=4,
content=org.eclipse.om2m.commons.resource.ContentInstance@126737f,
returnContentType=application/obj,
requestContentType=application/obj,
]
[INFO] - org.eclipse.om2m.core.router.Router
Request handling in the current CSE: /mn-cse/mn-name/MY_GPS/DATA
[INFO] - org.eclipse.om2m.core.router.Router
ResourceController to be used [ContentInstanceController]
[INFO] - org.eclipse.om2m.core.controller.Controller
Deleting oldest content instance due to container size limit: /mn-cse/mn-name/MY_GPS/DATA/cin_552939908
[INFO] - org.eclipse.om2m.core.router.Router
Response in Router= ResponsePrimitive [responseStatusCode=2001,
content=org.eclipse.om2m.commons.resource.ContentInstance@7bb20b,
to=admin:admin,
from=/mn-cse,
location=/mn-cse/cin-988765717,
]
[INFO] - org.eclipse.om2m.core.notifier.Notifier
Sending notify request to: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.notifier.Notifier
Sending notify request...
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=5,
to=/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_988765717">
<ty>4</ty>
<ri>/mn-cse/cin-988765717</ri>
<pi>/mn-cse/cnt-451289210</pi>
<ct>20160727T083553</ct>
<lt>20160727T083553</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>126</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8703431667,2.30734966667&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.core.router.Router
No Accept parameter set, setting to default: application/xml
[INFO] - org.eclipse.om2m.core.router.Router
Request targeting another CSE, forwarding to Redirector: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.redirector.Redirector
RemoteCSE found: /in-cse
[INFO] - org.eclipse.om2m.core.comm.RestClient
the requestIndication RC: RequestPrimitive [operation=5,
to=http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_988765717">
<ty>4</ty>
<ri>/mn-cse/cin-988765717</ri>
<pi>/mn-cse/cnt-451289210</pi>
<ct>20160727T083553</ct>
<lt>20160727T083553</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>126</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8703431667,2.30734966667&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Sending request: RequestPrimitive [operation=5,
to=http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_988765717">
<ty>4</ty>
<ri>/mn-cse/cin-988765717</ri>
<pi>/mn-cse/cnt-451289210</pi>
<ct>20160727T083553</ct>
<lt>20160727T083553</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>126</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8703431667,2.30734966667&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Request to be send: POST http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS HTTP/1.1
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Headers:
Accept: application/xml
X-M2M-Origin: /mn-cse
Content-Type: application/xml

[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Target is not reachable: http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.comm.RestClient
ResponsePrimitive [responseStatusCode=5103,
content=Target is not reachable: http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS,
to=/mn-cse,
from=/mn-cse,
contentType=text/plain,
]
value is : 48.8703616667,2.3073195
48.8703616667,2.3073195
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=1,
to=/mn-cse/mn-name/MY_GPS/DATA,
from=admin:admin,
resourceType=4,
content=org.eclipse.om2m.commons.resource.ContentInstance@1d294d9,
returnContentType=application/obj,
requestContentType=application/obj,
]
[INFO] - org.eclipse.om2m.core.router.Router
Request handling in the current CSE: /mn-cse/mn-name/MY_GPS/DATA
[INFO] - org.eclipse.om2m.core.router.Router
ResourceController to be used [ContentInstanceController]
[INFO] - org.eclipse.om2m.core.controller.Controller
Deleting oldest content instance due to container size limit: /mn-cse/mn-name/MY_GPS/DATA/cin_7598390
[INFO] - org.eclipse.om2m.core.router.Router
Response in Router= ResponsePrimitive [responseStatusCode=2001,
content=org.eclipse.om2m.commons.resource.ContentInstance@1c32d01,
to=admin:admin,
from=/mn-cse,
location=/mn-cse/cin-903184086,
]
[INFO] - org.eclipse.om2m.core.notifier.Notifier
Sending notify request to: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.notifier.Notifier
Sending notify request...
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=5,
to=/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_903184086">
<ty>4</ty>
<ri>/mn-cse/cin-903184086</ri>
<pi>/mn-cse/cnt-451289210</pi>
<ct>20160727T083558</ct>
<lt>20160727T083558</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>122</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8703616667,2.3073195&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.core.router.Router
No Accept parameter set, setting to default: application/xml
[INFO] - org.eclipse.om2m.core.router.Router
Request targeting another CSE, forwarding to Redirector: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.redirector.Redirector
RemoteCSE found: /in-cse
[INFO] - org.eclipse.om2m.core.comm.RestClient
the requestIndication RC: RequestPrimitive [operation=5,
to=http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_903184086">
<ty>4</ty>
<ri>/mn-cse/cin-903184086</ri>
<pi>/mn-cse/cnt-451289210</pi>
<ct>20160727T083558</ct>
<lt>20160727T083558</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>122</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8703616667,2.3073195&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Sending request: RequestPrimitive [operation=5,
to=http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_903184086">
<ty>4</ty>
<ri>/mn-cse/cin-903184086</ri>
<pi>/mn-cse/cnt-451289210</pi>
<ct>20160727T083558</ct>
<lt>20160727T083558</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>122</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8703616667,2.3073195&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Request to be send: POST http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS HTTP/1.1
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Headers:
Accept: application/xml
X-M2M-Origin: /mn-cse
Content-Type: application/xml

[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Target is not reachable: http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.comm.RestClient
ResponsePrimitive [responseStatusCode=5103,
content=Target is not reachable: http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS,
to=/mn-cse,
from=/mn-cse,
contentType=text/plain,
]

Thanks in advance!!

Can

Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739088 is a reply to message #1739001] Wed, 27 July 2016 13:30
Can LIU is currently offline Can LIUFriend
Messages: 22
Registered: May 2016
Junior Member
Hi madhi,

This afternoon, i tried to replace the" nu=/in-cse/in-name/MY_AEGPS " with the" ri(/in-cse/CAE306921645) "of the AE.
It doesn't work with the same error massage 4103 both in the MN and IN side.
Do you have some other advice to try?

Thanks

Can
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739091 is a reply to message #1739088] Wed, 27 July 2016 13:35
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 173
Registered: November 2013
Senior Member
Dear Can LIU

Which version of OM2M are you using ? Could you try with latest one OM2M-1.0.0
http://wiki.eclipse.org/OM2M/Download
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739102 is a reply to message #1739091] Wed, 27 July 2016 14:22
Can LIU is currently offline Can LIUFriend
Messages: 22
Registered: May 2016
Junior Member
Hi madhi,

I am already using the latest version 1.0.0 Sad

Cdr

Can
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739107 is a reply to message #1739102] Wed, 27 July 2016 14:40
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 173
Registered: November 2013
Senior Member
Dear Can,

The log you send shows a not reachable error 5103.
Could you please provide a clean log with 1 AE and 1 subscription ?
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739114 is a reply to message #1739107] Wed, 27 July 2016 15:07
Can LIU is currently offline Can LIUFriend
Messages: 22
Registered: May 2016
Junior Member
Hi madhi,

Yes, I started from the zero.
There is one IN-AE named MY_AEGPS and there is one subscription named SUB_MY_GPS which has a "nu = /in-cse/in-name/MY_AEGPS "
Please see from the picture:
index.php/fa/26583/0/
index.php/fa/26584/0/

And this is the log informations:
IN side:
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
----------------------------------------------------------------------------------------------
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Built RequestPrimitive: RequestPrimitive [to=/in-cse/in-name/MY_AEGPS,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_146952002">
<ty>4</ty>
<ri>/mn-cse/cin-146952002</ri>
<pi>/mn-cse/cnt-604053285</pi>
<ct>20160727T145907</ct>
<lt>20160727T145907</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>120</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8704238333,2.30724&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Content type headers: application/xml
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Header value: application/xml
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Accept header: application/xml
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=5,
to=/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_146952002">
<ty>4</ty>
<ri>/mn-cse/cin-146952002</ri>
<pi>/mn-cse/cnt-604053285</pi>
<ct>20160727T145907</ct>
<lt>20160727T145907</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>120</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8704238333,2.30724&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
queryStrings={}]
[INFO] - org.eclipse.om2m.core.router.Router
Request handling in the current CSE: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.router.Router
OM2M exception caught in Router: Unknown or unauthorized originator
[INFO] - org.eclipse.om2m.core.router.Router
Response in Router= ResponsePrimitive [responseStatusCode=4103,
content=Unknown or unauthorized originator,
to=/mn-cse,
from=/in-cse,
contentType=text/plain,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
----------------------------------------------------------------------------------------------
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Built RequestPrimitive: RequestPrimitive [to=/in-cse/in-name/MY_AEGPS,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_387799639">
<ty>4</ty>
<ri>/mn-cse/cin-387799639</ri>
<pi>/mn-cse/cnt-604053285</pi>
<ct>20160727T145912</ct>
<lt>20160727T145912</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>123</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8704235,2.30724283333&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Content type headers: application/xml
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Header value: application/xml
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Accept header: application/xml
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=5,
to=/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_387799639">
<ty>4</ty>
<ri>/mn-cse/cin-387799639</ri>
<pi>/mn-cse/cnt-604053285</pi>
<ct>20160727T145912</ct>
<lt>20160727T145912</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>123</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8704235,2.30724283333&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
queryStrings={}]
[INFO] - org.eclipse.om2m.core.router.Router
Request handling in the current CSE: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.router.Router
OM2M exception caught in Router: Unknown or unauthorized originator
[INFO] - org.eclipse.om2m.core.router.Router
Response in Router= ResponsePrimitive [responseStatusCode=4103,
content=Unknown or unauthorized originator,
to=/mn-cse,
from=/in-cse,
contentType=text/plain,
]


And MN side:

value is : 48.8704158333,2.3072625
48.8704158333,2.3072625
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=1,
to=/mn-cse/mn-name/MY_GPS/DATA,
from=admin:admin,
resourceType=4,
content=org.eclipse.om2m.commons.resource.ContentInstance@8b199f,
returnContentType=application/obj,
requestContentType=application/obj,
]
[INFO] - org.eclipse.om2m.core.router.Router
Request handling in the current CSE: /mn-cse/mn-name/MY_GPS/DATA
[INFO] - org.eclipse.om2m.core.router.Router
ResourceController to be used [ContentInstanceController]
[INFO] - org.eclipse.om2m.core.router.Router
Response in Router= ResponsePrimitive [responseStatusCode=2001,
content=org.eclipse.om2m.commons.resource.ContentInstance@c8a03e,
to=admin:admin,
from=/mn-cse,
location=/mn-cse/cin-423048316,
]
[INFO] - org.eclipse.om2m.core.notifier.Notifier
Sending notify request to: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.notifier.Notifier
Sending notify request...
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=5,
to=/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_423048316">
<ty>4</ty>
<ri>/mn-cse/cin-423048316</ri>
<pi>/mn-cse/cnt-604053285</pi>
<ct>20160727T145917</ct>
<lt>20160727T145917</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>122</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8704158333,2.3072625&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.core.router.Router
No Accept parameter set, setting to default: application/xml
[INFO] - org.eclipse.om2m.core.router.Router
Request targeting another CSE, forwarding to Redirector: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.redirector.Redirector
RemoteCSE found: /in-cse
[INFO] - org.eclipse.om2m.core.comm.RestClient
the requestIndication RC: RequestPrimitive [operation=5,
to=http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_423048316">
<ty>4</ty>
<ri>/mn-cse/cin-423048316</ri>
<pi>/mn-cse/cnt-604053285</pi>
<ct>20160727T145917</ct>
<lt>20160727T145917</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>122</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8704158333,2.3072625&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Sending request: RequestPrimitive [operation=5,
to=http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS,
from=/mn-cse,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_423048316">
<ty>4</ty>
<ri>/mn-cse/cin-423048316</ri>
<pi>/mn-cse/cnt-604053285</pi>
<ct>20160727T145917</ct>
<lt>20160727T145917</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>122</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.8704158333,2.3072625&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Request to be send: POST http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS HTTP/1.1
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Headers:
Accept: application/xml
X-M2M-Origin: /mn-cse
Content-Type: application/xml

[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Http Client response: ResponsePrimitive [responseStatusCode=4103,
content=Unknown or unauthorized originator
,
to=/mn-cse,
from=/mn-cse,
contentType=text/plain;charset=ISO-8859-1,
]
[INFO] - org.eclipse.om2m.core.comm.RestClient
ResponsePrimitive [responseStatusCode=4103,
content=Unknown or unauthorized originator
,
to=/mn-cse,
from=/mn-cse,
contentType=text/plain;charset=ISO-8859-1,
]


Both of the two side are shows the error of 4103.

Thanks in advance.

Can


Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739122 is a reply to message #1739114] Wed, 27 July 2016 15:39
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 173
Registered: November 2013
Senior Member
Dear Can,

Thank you for the detailed log. Your requests are correct. I think there is an issue with the CSE ACP validation.
Are you using the source code or the binaries ?
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739127 is a reply to message #1739122] Wed, 27 July 2016 15:46
Can LIU is currently offline Can LIUFriend
Messages: 22
Registered: May 2016
Junior Member
Hi madhi,

What is the binaries? Sorry for this stupide question.
I downloaded the OM2M in the website and follow the instruction to build it on my computer(IN) and a did the same on Raspberry Pi (MN).
Did I answer your question?

Can
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739128 is a reply to message #1739122] Wed, 27 July 2016 15:49
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 173
Registered: November 2013
Senior Member
The solution is to replace the line 233 of the file: org/eclipse/om2m/core/notifier/Notifier.java
request.setFrom("/" + Constants.CSE_ID);
with:
request.setFrom(Constants.ADMIN_REQUESTING_ENTITY);

Could you please open a bug related to this issue on our Bugzilla ?
I will submit a patch as soon as possible.
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739130 is a reply to message #1739122] Wed, 27 July 2016 15:50
Can LIU is currently offline Can LIUFriend
Messages: 22
Registered: May 2016
Junior Member
Hi madhi,

I use eclipse and clone the code from git and build it on my computer.
I download the OM2M but i didn't use it.

Can
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739131 is a reply to message #1739128] Wed, 27 July 2016 15:51
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 173
Registered: November 2013
Senior Member
I mean by binaries the compiled files.
You can try the fix directly on your source code.
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739132 is a reply to message #1739131] Wed, 27 July 2016 15:53
Can LIU is currently offline Can LIUFriend
Messages: 22
Registered: May 2016
Junior Member
mahdi,

Ok i will try it.
Could you please give me a link with the bugzilla?

Thanks

Can
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739133 is a reply to message #1739132] Wed, 27 July 2016 15:55
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 173
Registered: November 2013
Senior Member
Here you are:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=OM2M
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739134 is a reply to message #1739133] Wed, 27 July 2016 16:01
Can LIU is currently offline Can LIUFriend
Messages: 22
Registered: May 2016
Junior Member
Thank you so much Smile

Hava a wonderful day!

Can
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739137 is a reply to message #1739134] Wed, 27 July 2016 16:10
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 173
Registered: November 2013
Senior Member
So it works for you ?
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739139 is a reply to message #1739137] Wed, 27 July 2016 16:52
Can LIU is currently offline Can LIUFriend
Messages: 22
Registered: May 2016
Junior Member
Hi mahdi,

I tired but it still not work.

Here is the log:

IN side:
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
----------------------------------------------------------------------------------------------
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Built RequestPrimitive: RequestPrimitive [to=/in-cse/in-name/MY_AEGPS,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_299781469">
<ty>4</ty>
<ri>/mn-cse/cin-299781469</ri>
<pi>/mn-cse/cnt-99436495</pi>
<ct>20160727T162652</ct>
<lt>20160727T162652</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>122</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.870399,2.30734916667&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Content type headers: application/xml
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Header value: application/xml
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Accept header: application/xml
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=5,
to=/in-cse/in-name/MY_AEGPS,
from=admin:admin,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_299781469">
<ty>4</ty>
<ri>/mn-cse/cin-299781469</ri>
<pi>/mn-cse/cnt-99436495</pi>
<ct>20160727T162652</ct>
<lt>20160727T162652</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>122</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.870399,2.30734916667&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
queryStrings={}]
[INFO] - org.eclipse.om2m.core.router.Router
Request handling in the current CSE: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.router.Router
OM2M exception caught in Router: AE has no point of access
[INFO] - org.eclipse.om2m.core.router.Router
Response in Router= ResponsePrimitive [responseStatusCode=5103,
content=AE has no point of access,
to=admin:admin,
from=/in-cse,
contentType=text/plain,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
----------------------------------------------------------------------------------------------
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Built RequestPrimitive: RequestPrimitive [to=/in-cse/CAE203979419,
resultContent=5,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpServlet
Accept header: application/xml
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=2,
to=/in-cse/CAE203979419,
from=admin:admin,
resultContent=5,
returnContentType=application/xml,
requestContentType=application/xml,
queryStrings={rcn=[5]}]
[INFO] - org.eclipse.om2m.core.router.Router
Request handling in the current CSE: /in-cse/CAE203979419
[INFO] - org.eclipse.om2m.core.router.Router
ResourceController to be used [AEController]
[INFO] - org.eclipse.om2m.core.router.Router
OM2M exception caught in Router: Resource not found
[INFO] - org.eclipse.om2m.core.router.Router
Response in Router= ResponsePrimitive [responseStatusCode=4004,
content=Resource not found,
to=admin:admin,
from=/in-cse,
contentType=text/plain,
]



MN side:

[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Request to be send: POST http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS HTTP/1.1
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Headers:
Accept: application/xml
X-M2M-Origin: admin:admin
Content-Type: application/xml

[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Http Client response: ResponsePrimitive [responseStatusCode=5103,
content=AE has no point of access
,
to=admin:admin,
from=/mn-cse,
contentType=text/plain;charset=ISO-8859-1,
]
[INFO] - org.eclipse.om2m.core.comm.RestClient
ResponsePrimitive [responseStatusCode=5103,
content=AE has no point of access
,
to=admin:admin,
from=/mn-cse,
contentType=text/plain;charset=ISO-8859-1,
]
stvalue is : 48.870399,2.30734916667
48.870399,2.30734916667
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=1,
to=/mn-cse/mn-name/MY_GPS/DATA,
from=admin:admin,
resourceType=4,
content=org.eclipse.om2m.commons.resource.ContentInstance@95bf39,
returnContentType=application/obj,
requestContentType=application/obj,
]
[INFO] - org.eclipse.om2m.core.router.Router
Request handling in the current CSE: /mn-cse/mn-name/MY_GPS/DATA
[INFO] - org.eclipse.om2m.core.router.Router
ResourceController to be used [ContentInstanceController]
o[INFO] - org.eclipse.om2m.core.notifier.Notifier
Sending notify request to: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.notifier.Notifier
Sending notify request...
[INFO] - org.eclipse.om2m.core.router.Router
Response in Router= ResponsePrimitive [responseStatusCode=2001,
content=org.eclipse.om2m.commons.resource.ContentInstance@59cdaa,
to=admin:admin,
from=/mn-cse,
location=/mn-cse/cin-299781469,
]
[INFO] - org.eclipse.om2m.core.router.Router
Received request in Router: RequestPrimitive [operation=5,
to=/in-cse/in-name/MY_AEGPS,
from=admin:admin,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_299781469">
<ty>4</ty>
<ri>/mn-cse/cin-299781469</ri>
<pi>/mn-cse/cnt-99436495</pi>
<ct>20160727T162652</ct>
<lt>20160727T162652</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>122</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.870399,2.30734916667&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.core.router.Router
No Accept parameter set, setting to default: application/xml
[INFO] - org.eclipse.om2m.core.router.Router
Request targeting another CSE, forwarding to Redirector: /in-cse/in-name/MY_AEGPS
[INFO] - org.eclipse.om2m.core.redirector.Redirector
RemoteCSE found: /in-cse
[INFO] - org.eclipse.om2m.core.comm.RestClient
the requestIndication RC: RequestPrimitive [operation=5,
to=http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS,
from=admin:admin,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_299781469">
<ty>4</ty>
<ri>/mn-cse/cin-299781469</ri>
<pi>/mn-cse/cnt-99436495</pi>
<ct>20160727T162652</ct>
<lt>20160727T162652</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>122</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.870399,2.30734916667&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Sending request: RequestPrimitive [operation=5,
to=http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS,
from=admin:admin,
content=<?xml version="1.0" encoding="UTF-8"?>
<m2m:sgn xmlns:m2m="http://www.onem2m.org/xml/protocols">
<nev>
<rep rn="cin_299781469">
<ty>4</ty>
<ri>/mn-cse/cin-299781469</ri>
<pi>/mn-cse/cnt-99436495</pi>
<ct>20160727T162652</ct>
<lt>20160727T162652</lt>
<st>0</st>
<cnf>application/obix</cnf>
<cs>122</cs>
<con>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?>
&lt;obj>
&lt;str val=&quot;48.870399,2.30734916667&quot; name=&quot;data&quot;/>
&lt;/obj>
</con>
</rep>
<rss>1</rss>
</nev>
<sud>false</sud>
<sur>/mn-cse/mn-name/MY_GPS/DATA/SUB_MY_GPS</sur>
</m2m:sgn>
,
returnContentType=application/xml,
requestContentType=application/xml,
]
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Request to be send: POST http://10.42.14.201:8080/~/in-cse/in-name/MY_AEGPS HTTP/1.1
[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Headers:
Accept: application/xml
X-M2M-Origin: admin:admin
Content-Type: application/xml

[INFO] - org.eclipse.om2m.binding.http.RestHttpClient
Http Client response: ResponsePrimitive [responseStatusCode=5103,
content=AE has no point of access
,
to=admin:admin,
from=/mn-cse,
contentType=text/plain;charset=ISO-8859-1,
]
[INFO] - org.eclipse.om2m.core.comm.RestClient
ResponsePrimitive [responseStatusCode=5103,
content=AE has no point of access
,
to=admin:admin,
from=/mn-cse,
contentType=text/plain;charset=ISO-8859-1,
]

Some idea?

Can
Re: responseStatusCode=4103 (Unknown or unauthorized originator) when notify to AE resource [message #1739141 is a reply to message #1739139] Wed, 27 July 2016 16:54
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 173
Registered: November 2013
Senior Member
You need to set the reachability of your AE to true Wink
Check the rr attribute.
Forum: Remote Application Platform (RAP)
 Topic: RAP platform build fails on fresh clone of 3.1-maintenance
Re: RAP platform build fails on fresh clone of 3.1-maintenance [message #1739038 is a reply to message #1739020] Wed, 27 July 2016 07:04
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2124
Registered: July 2009
Senior Member
Hi,
this test needs "client.js", produced by ClientBuilder. Please, run the
"org.eclipse.rap.clientbuilder", located in "releng" folder first.
Regards,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
 Topic: Occasional Network Error popup
Re: Occasional Network Error popup [message #1739040 is a reply to message #1739007] Wed, 27 July 2016 07:17
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 146
Registered: January 2012
Senior Member
Hi Ivan,
thank you, I tried, but doesn't work.
But there is something more basic that I do not understand:
if I get it correctly (I am very poor at JS) from your very first snippet in this thread, this is a way to override the original method.
Assuming this, then this variant:

       String script = 
        		"(function() {"
        		+ "		var origShowErrorBox=rwt.runtime.ErrorHandler.showErrorBox;"
        		+ "		rwt.runtime.ErrorHandler.showErrorBox = function(errorType, freeze, errorDetails){"
        		+ "			origShowErrorBox(errorType, freeze, errorDetails);"
        		+ "		};"
        		+ "}()"
        		+ ");";

should have zero-effect, that is, should override the showErrorBox() method with itself unchanged.

Instead if I try this (just stopping the server and trying to continue to use the application) I see a different behaviour with or without executing this script: without executing a get a Network Error popup, while executing this I get no popup, just the application doesn't respond (which is normal since the server is stopped).
Shouldn't the behaviour be the same?
What am I missing?
Thank you
Vincenzo
Re: Occasional Network Error popup [message #1739043 is a reply to message #1739040] Wed, 27 July 2016 08:03
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2124
Registered: July 2009
Senior Member
Hi Vincenzo,
here is a working Java function:
---
private static void patchClient() {
JavaScriptExecutor executor = RWT.getClient().getService(
JavaScriptExecutor.class );
StringBuilder builder = new StringBuilder();
builder.append( "(function() {" );
builder.append( " var errorHandler = rwt.runtime.ErrorHandler;" );
builder.append( " var origShowErrorBox = rwt.util.Functions.bind(
errorHandler.showErrorBox, errorHandler );" );
builder.append( " errorHandler.showErrorBox = function( errorType,
freeze, errorDetails ) {" );
builder.append( " if( errorType === \"connection error\" ) {" );
builder.append( " setTimeout( function() {");
builder.append( " rwt.remote.Connection.getInstance()._retry();" );
builder.append( " }, 100 );");
builder.append( " } else {");
builder.append( " origShowErrorBox( errorType, freeze,
errorDetails );");
builder.append( " }");
builder.append( " };" );
builder.append( "}() );" );
executor.execute( builder.toString() );
}
---
The "context" was not set when the original function is called.
HTH,
Ivan

On 7/27/2016 10:17, Vincenzo Caselli wrote:
> origShowErrorBox(errorType, freeze, errorDetails);

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Occasional Network Error popup [message #1739061 is a reply to message #1739043] Wed, 27 July 2016 09:24
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 146
Registered: January 2012
Senior Member
Wow, thanks Ivan!
I cannot still test it on customer scenario, but on my pc the test that I did before (stopping the server) are now working!!
Thank you very much again.
Vincenzo
 Topic: a simple implementation of swipe slider
a simple implementation of swipe slider [message #1739138] Wed, 27 July 2016 16:27
zone whua is currently offline zone whuaFriend
Messages: 7
Registered: July 2009
Location: Wuhan China
Junior Member
A swipe slider is a frequently-used control in mobile application.
here is some tips. Laughing

Frist part, we need to create a customized widget.
Step1. Select a JS slider lib. e.g. flexslider
Step2. write handler.js
after that, we get a slider, support html sliding, but we need add composite in slider.

Second part, add control to slider.
Step1. name every slide.
	public void addControl(Control control, String thumbUrl) {
		if (items == null) {
			items = new ArrayList<Map<String, String>>();
		}
		UIToolkit.setAttribute(control, "name", "slider"+items.size());
               //rap.getObject( '", id, "' ).", $el, ".attr( '", attr, "', '", value + "' );
		Map<String, String> map = new HashMap<String, String>();
		map.put("name", "slider");
		map.put("thumb", thumbUrl);
		items.add(map);
	}

Step2.modify handler.js, find control, move it into slide and fix css
		onRender : function() {
			rap.off("render", this.onRender);
			var i;
			for (i in this.setting.items) {
				var item = document.createElement("li");
				item.setAttribute("data-thumb", this.setting.items[i].thumb);
					var slider = $("[name='slider" + i + "']");
					slider.css({
						"position" : "relative",
						"width" : "100%"
					});
					slider.attr({"name":"appended"});
					slider.appendTo(item);
				this.ul.appendChild(item);
			}


[Updated on: Wed, 27 July 2016 16:43]

Report message to a moderator

 Topic: Get client location from browser
Get client location from browser [message #1739142] Wed, 27 July 2016 16:57
zone whua is currently offline zone whuaFriend
Messages: 7
Registered: July 2009
Location: Wuhan China
Junior Member
To get location of client browser. a simple method is to use html5 Geolocation.
Add a js lib is simple method to get it. e.g. google map or something else. I use baidu map.
only 3 step,s we can make apps get ur phone location.
1. import js in head.html
...
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=<some ak code>"></script>
...
2. write a very simple class
public class Locator {
	
	private static final String REMOTE_TYPE = "bizvision.locator";

	private final RemoteObject remoteObject;

	protected Location value;
	
	private final OperationHandler operationHandler = new AbstractOperationHandler() {

		public void handleCall(String method, JsonObject parameters) {
			GsonBuilder builder = new GsonBuilder();
			Gson gson = builder.create();
			Locator.this.value = gson.fromJson(parameters.toString(), Location.class);
		}
	};

	public Locator() {
		loadJavaScript();
		Connection connection = RWT.getUISession().getConnection();
		remoteObject = connection.createRemoteObject(REMOTE_TYPE);
		remoteObject.setHandler(operationHandler);
	}
	
	private void loadJavaScript() {
		JavaScriptLoader jsLoader = RWT.getClient().getService(JavaScriptLoader.class);
		jsLoader.require("/apps/widgets/common/js/locatorhandler.js");
	}
	
	public Location getLocation(){
		return value;
	}

}


3. handler.js
(function() {
	'use strict';

	rap.registerTypeHandler("bizvision.locator", {

		factory : function(properties) {
			return new bizvision.locator(properties);
		},

		properties : [ "callback" ]

	});

	if (!window.bizvision) {
		window.bizvision = {};
	}

	bizvision.locator = function(properties) {
		bindAll(this, [ "onRender" ]);
		rap.on("render", this.onRender);
	};

	bizvision.locator.prototype = {

		onRender : function() {
			rap.off("render", this.onRender);
			var ro = rap.getRemoteObject(this);
			var geolocation = new BMap.Geolocation();
			geolocation.getCurrentPosition(function(r){
				if(this.getStatus() == BMAP_STATUS_SUCCESS){
					ro.call("callback", r);
				}        
			},{enableHighAccuracy: true});
			
		}

	};

	var bind = function(context, method) {
		return function() {
			return method.apply(context, arguments);
		};
	};

	var bindAll = function(context, methodNames) {
		for (var i = 0; i < methodNames.length; i++) {
			var method = context[methodNames[i]];
			context[methodNames[i]] = bind(context, method);
		}
	};

	var async = function(context, func) {
		window.setTimeout(function() {
			func.apply(context);
		}, 0);
	};

}());


wish it will help you.

[Updated on: Wed, 27 July 2016 16:57]

Report message to a moderator




Current Time: Wed Jul 27 17:38:47 GMT 2016

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

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