Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Strange errors when using several model files
Strange errors when using several model files [message #764225] Sun, 11 December 2011 17:55 Go to next message
Ingo Meyer is currently offline Ingo MeyerFriend
Messages: 162
Registered: July 2009
Senior Member
Hi,

when I have two or more model files of my DSL (based on the Domainmodel example) and I copy an entity (which is referenced from other entities) from one file to another,
I get the following error:


!ENTRY org.eclipse.core.jobs 4 2 2011-12-11 18:52:22.378
!MESSAGE An internal error occurred during: "Xtext validation".
!STACK 0
org.eclipse.emf.common.util.WrappedException: org.eclipse.emf.common.util.WrappedException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at org.eclipse.xtext.util.OnChangeEvictingCache.execWithoutCacheClear(OnChangeEvictingCache.java:123)
	at org.eclipse.xtext.xbase.resource.XbaseResource.getEObject(XbaseResource.java:225)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:143)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:104)
	at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:491)
	at org.eclipse.xtext.validation.ResourceValidatorImpl.resolveProxies(ResourceValidatorImpl.java:127)
	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:62)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.java:79)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.java:1)
	at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:32)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:78)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob.createIssues(ValidationJob.java:75)
	at org.eclipse.xtext.ui.editor.validation.ValidationJob.run(ValidationJob.java:64)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:209)
	at org.eclipse.xtext.xbase.resource.XbaseResource.access$0(XbaseResource.java:1)
	at org.eclipse.xtext.xbase.resource.XbaseResource$2.exec(XbaseResource.java:227)
	at org.eclipse.xtext.xbase.resource.XbaseResource$2.exec(XbaseResource.java:1)
	at org.eclipse.xtext.util.OnChangeEvictingCache.execWithoutCacheClear(OnChangeEvictingCache.java:121)
	... 13 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(String.java:1937)
	at org.eclipse.xtext.common.types.access.impl.IndexedJvmTypeAccess.resolveJavaObject(IndexedJvmTypeAccess.java:98)
	at org.eclipse.xtext.common.types.access.impl.IndexedJvmTypeAccess.resolveJavaObject(IndexedJvmTypeAccess.java:99)
	at org.eclipse.xtext.common.types.access.impl.IndexedJvmTypeAccess.getIndexedJvmType(IndexedJvmTypeAccess.java:59)
	at org.eclipse.xtext.common.types.access.jdt.JdtTypeProvider.findTypeByName(JdtTypeProvider.java:85)
	at org.eclipse.xtext.common.types.xtext.AbstractTypeScope.getSingleElement(AbstractTypeScope.java:54)
	at org.eclipse.xtext.common.types.xtext.AbstractTypeScope.getElements(AbstractTypeScope.java:68)
	at org.eclipse.xtext.scoping.impl.AbstractScope$2.get(AbstractScope.java:135)
	at org.eclipse.xtext.scoping.impl.AbstractScope$2.get(AbstractScope.java:1)
	at org.eclipse.xtext.scoping.impl.AbstractScope$ParentIterable.iterator(AbstractScope.java:59)
	at com.google.common.collect.Iterables$3.next(Iterables.java:505)
	at com.google.common.collect.Iterables$3.next(Iterables.java:498)
	at com.google.common.collect.Iterators$5.hasNext(Iterators.java:540)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:643)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
	at com.google.common.collect.Iterators$5.hasNext(Iterators.java:539)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:643)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
	at com.google.common.collect.Iterators$5.hasNext(Iterators.java:539)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:643)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
	at com.google.common.collect.Iterators$5.hasNext(Iterators.java:539)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:643)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
	at com.google.common.collect.Iterators$5.hasNext(Iterators.java:539)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:643)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
	at com.google.common.collect.Iterators$5.hasNext(Iterators.java:539)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:643)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
	at com.google.common.collect.Iterators$5.hasNext(Iterators.java:539)
	at org.eclipse.xtext.scoping.impl.ImportScope.getLocalElementsByName(ImportScope.java:154)
	at org.eclipse.xtext.scoping.impl.ImportScope.getSingleLocalElementByName(ImportScope.java:140)
	at org.eclipse.xtext.scoping.impl.AbstractScope.getSingleElement(AbstractScope.java:102)
	at org.eclipse.xtext.scoping.impl.AbstractScope.getSingleElement(AbstractScope.java:105)
	at org.eclipse.xtext.scoping.impl.AbstractScope.getSingleElement(AbstractScope.java:105)
	at org.eclipse.xtext.scoping.impl.AbstractScope.getSingleElement(AbstractScope.java:105)
	at org.eclipse.xtext.scoping.impl.AbstractScope.getSingleElement(AbstractScope.java:105)
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:121)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:175)
	... 17 more


I cannot find any of my classes in the stack and the error is shown in the editor inside a error dialog.
This is quite annoying but I have no idea where it comes from...

Any ideas on this?

Thanks,
Ingo
Re: Strange errors when using several model files [message #764242 is a reply to message #764225] Sun, 11 December 2011 18:40 Go to previous messageGo to next message
Meinte Boersma is currently offline Meinte BoersmaFriend
Messages: 434
Registered: July 2009
Location: Leiden, Netherlands
Senior Member
Are you doing anything with a JVM type which resides in the default package, perhaps?

Re: Strange errors when using several model files [message #764471 is a reply to message #764242] Mon, 12 December 2011 08:54 Go to previous messageGo to next message
Ingo Meyer is currently offline Ingo MeyerFriend
Messages: 162
Registered: July 2009
Senior Member
Meinte, I don't know exactly what you mean, but could it have something to do with the inferred type of my moved element which doesn't find its association anymore (of course, I have moved...)?
But I would say that this is a bug in Xtext then?
Re: Strange errors when using several model files [message #764488 is a reply to message #764471] Mon, 12 December 2011 09:35 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Am 12/12/11 9:54 AM, schrieb Ingo Meyer:
> Meinte, I don't know exactly what you mean, but could it have something
> to do with the inferred type of my moved element which doesn't find its
> association anymore (of course, I have moved...)?
> But I would say that this is a bug in Xtext then?

Please file a bugzilla with instructions to reproduce the problem.

Thanks,
Sven

--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Previous Topic:problem combining importURI and importNamespace
Next Topic:Qualified Name to a custom scope
Goto Forum:
  


Current Time: Sat Mar 06 18:20:07 GMT 2021

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

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

Back to the top