Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Error: Cyclic resolution of lazy links
Error: Cyclic resolution of lazy links [message #1754384] Fri, 17 February 2017 07:24 Go to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
Model:
	greetings+=(Greeting| Test | Greeting2)*;

XID:
	ID | 'Bye' | 'Hello'
;

Greeting2:
	'Change' xName=[Greeting|XID] 'to' str=XID 
;

Greeting:
	'Hello' sample=[Test|XID] 'age' age=INT '!';
Test:
	'Bye' sName=XID '!' 'see' 'you' date=ID';'
;



I created my QualifiedNameProvider like this:
QualifiedName qualifiedName(Greeting obj) {
			return QualifiedName.create(obj.getSample().getSName());
	}


But I get this Cyclic resolution of lazy link error.

1    [main] ERROR xt.linking.lazy.LazyLinkingResource  - Cyclic resolution of lazy links : Greeting2.xName->Greeting2.xName in resource 'test.Mydsl'.
org.eclipse.xtext.linking.lazy.LazyLinkingResource$CyclicLinkingException: Cyclic resolution of lazy links : Greeting2.xName->Greeting2.xName in resource 'test.myDsl'.
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.handleCyclicResolution(LazyLinkingResource.java:302)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:240)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:222)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:199)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:259)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1477)
	at org.myDsl.impl.GreetingImpl.getSample(Unknown Source)
	at org.MyQualifiedNameProvider.qualifiedName(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:296)
	at org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider$2.get(DefaultDeclarativeQualifiedNameProvider.java:64)
	at org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider$2.get(DefaultDeclarativeQualifiedNameProvider.java:1)
	at org.eclipse.xtext.util.OnChangeEvictingCache.get(OnChangeEvictingCache.java:77)
	at org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider.getFullyQualifiedName(DefaultDeclarativeQualifiedNameProvider.java:59)
	at org.eclipse.xtext.naming.IQualifiedNameProvider$AbstractImpl.apply(IQualifiedNameProvider.java:32)
	at org.eclipse.xtext.naming.IQualifiedNameProvider$AbstractImpl.apply(IQualifiedNameProvider.java:1)
	at org.eclipse.xtext.scoping.Scopes$2.apply(Scopes.java:93)
	at org.eclipse.xtext.scoping.Scopes$2.apply(Scopes.java:1)
	at com.google.common.collect.Iterators$8.transform(Iterators.java:794)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:646)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
	at org.eclipse.xtext.scoping.impl.MultimapBasedSelectable.setExportedObjects(MultimapBasedSelectable.java:106)
	at org.eclipse.xtext.scoping.impl.MultimapBasedSelectable.<init>(MultimapBasedSelectable.java:36)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.internalGetAllDescriptions(ImportedNamespaceAwareLocalScopeProvider.java:236)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider$2.get(ImportedNamespaceAwareLocalScopeProvider.java:223)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider$2.get(ImportedNamespaceAwareLocalScopeProvider.java:1)
	at org.eclipse.xtext.util.OnChangeEvictingCache.get(OnChangeEvictingCache.java:77)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getAllDescriptions(ImportedNamespaceAwareLocalScopeProvider.java:220)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getResourceScope(ImportedNamespaceAwareLocalScopeProvider.java:113)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getResourceScope(ImportedNamespaceAwareLocalScopeProvider.java:102)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getScope(ImportedNamespaceAwareLocalScopeProvider.java:90)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getScope(ImportedNamespaceAwareLocalScopeProvider.java:88)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getScope(ImportedNamespaceAwareLocalScopeProvider.java:88)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getScope(ImportedNamespaceAwareLocalScopeProvider.java:88)
	at org.eclipse.xtext.scoping.impl.DelegatingScopeProvider.delegateGetScope(DelegatingScopeProvider.java:42)
	at org.eclipse.xtext.scoping.impl.DelegatingScopeProvider.getScope(DelegatingScopeProvider.java:38)
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getScope(DefaultLinkingService.java:59)
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:119)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:247)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:222)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:199)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:259)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1477)
	at org.myDsl.impl.GreetingImpl.getSample(Unknown Source)
	at org.MyQualifiedNameProvider.qualifiedName(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:296)
	at org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider$2.get(DefaultDeclarativeQualifiedNameProvider.java:64)
	at org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider$2.get(DefaultDeclarativeQualifiedNameProvider.java:1)
	at org.eclipse.xtext.util.OnChangeEvictingCache.get(OnChangeEvictingCache.java:77)
	at org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider.getFullyQualifiedName(DefaultDeclarativeQualifiedNameProvider.java:59)
	at org.eclipse.xtext.naming.IQualifiedNameProvider$AbstractImpl.apply(IQualifiedNameProvider.java:32)
	at org.eclipse.xtext.naming.IQualifiedNameProvider$AbstractImpl.apply(IQualifiedNameProvider.java:1)
	at org.eclipse.xtext.scoping.Scopes$2.apply(Scopes.java:93)
	at org.eclipse.xtext.scoping.Scopes$2.apply(Scopes.java:1)
	at com.google.common.collect.Iterators$8.transform(Iterators.java:794)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:646)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
	at org.eclipse.xtext.scoping.impl.MultimapBasedSelectable.setExportedObjects(MultimapBasedSelectable.java:106)
	at org.eclipse.xtext.scoping.impl.MultimapBasedSelectable.<init>(MultimapBasedSelectable.java:36)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.internalGetAllDescriptions(ImportedNamespaceAwareLocalScopeProvider.java:236)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider$2.get(ImportedNamespaceAwareLocalScopeProvider.java:223)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider$2.get(ImportedNamespaceAwareLocalScopeProvider.java:1)
	at org.eclipse.xtext.util.OnChangeEvictingCache.get(OnChangeEvictingCache.java:77)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getAllDescriptions(ImportedNamespaceAwareLocalScopeProvider.java:220)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getResourceScope(ImportedNamespaceAwareLocalScopeProvider.java:113)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getResourceScope(ImportedNamespaceAwareLocalScopeProvider.java:102)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getScope(ImportedNamespaceAwareLocalScopeProvider.java:90)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getScope(ImportedNamespaceAwareLocalScopeProvider.java:88)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getScope(ImportedNamespaceAwareLocalScopeProvider.java:88)
	at org.eclipse.xtext.scoping.impl.DelegatingScopeProvider.delegateGetScope(DelegatingScopeProvider.java:42)
	at org.eclipse.xtext.scoping.impl.DelegatingScopeProvider.getScope(DelegatingScopeProvider.java:38)
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getScope(DefaultLinkingService.java:59)
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:119)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:247)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:222)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doResolveLazyCrossReference(LazyLinkingResource.java:189)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:148)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:134)
	at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:498)
	at org.eclipse.xtext.validation.ResourceValidatorImpl.resolveProxies(ResourceValidatorImpl.java:161)
	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:74)
	at org.generator.Main.runValidator(Unknown Source)
	at org.generator.Main.main(Unknown Source)


What should my QualifiedNameProvider be if I am referring to a cross-reference?
Re: Error: Cyclic resolution of lazy links [message #1754386 is a reply to message #1754384] Fri, 17 February 2017 07:35 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11062
Registered: July 2009
Senior Member
You may not use cross refs in the nameprovider

You can use nodemodelutils to obtain
The text


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Previous Topic:How to disable error message from Composite EValidator
Next Topic:Autocompletion on deployed xtext feature not working
Goto Forum:
  


Current Time: Fri Aug 18 01:29:15 GMT 2017

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

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