Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cannot root twice
Cannot root twice [message #1721621] Thu, 28 January 2016 16:45 Go to next message
Ingo Meyer is currently offline Ingo MeyerFriend
Messages: 162
Registered: July 2009
Senior Member
I inferr a jvm model from my Xbase based domainmodel like DSL.
Also I generate a hibernate mapping XML file which I do in the ModelGenerator.

There I need the resolved types of my features. So far so good.

But as soon as I add an annotation with JvmCustomAnnotationValue's to a JvmField I get that exception in my XML compiler:

java.lang.RuntimeException: Cannot root twice
	at org.eclipse.xtext.xbase.typesystem.internal.DefaultBatchTypeResolver$1.add(DefaultBatchTypeResolver.java:73)
	at org.eclipse.xtext.xbase.typesystem.internal.DefaultBatchTypeResolver$1.add(DefaultBatchTypeResolver.java:1)
	at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver$1.add(LogicalContainerAwareReentrantTypeResolver.java:318)
	at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver$1.add(LogicalContainerAwareReentrantTypeResolver.java:1)
	at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.recordAnnotationExpressions(LogicalContainerAwareReentrantTypeResolver.java:601)
	at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.recordAnnotationExpressions(LogicalContainerAwareReentrantTypeResolver.java:587)
	at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver._recordExpressions(LogicalContainerAwareReentrantTypeResolver.java:425)
	at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.recordExpressions(LogicalContainerAwareReentrantTypeResolver.java:416)
	at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver._recordExpressions(LogicalContainerAwareReentrantTypeResolver.java:439)
	at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.recordExpressions(LogicalContainerAwareReentrantTypeResolver.java:412)
	at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.prepare(LogicalContainerAwareReentrantTypeResolver.java:401)
	at org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver.computeTypes(LogicalContainerAwareReentrantTypeResolver.java:689)
	at org.eclipse.xtext.xbase.typesystem.internal.DefaultReentrantTypeResolver.resolve(DefaultReentrantTypeResolver.java:163)
	at org.eclipse.xtext.xbase.typesystem.internal.DefaultReentrantTypeResolver.reentrantResolve(DefaultReentrantTypeResolver.java:139)
	at org.eclipse.xtext.xbase.typesystem.internal.CompoundReentrantTypeResolver.getDelegate(CompoundReentrantTypeResolver.java:108)
	at org.eclipse.xtext.xbase.typesystem.internal.CompoundReentrantTypeResolver.getActualType(CompoundReentrantTypeResolver.java:202)
	at org.eclipse.xtext.xbase.typesystem.internal.ForwardingResolvedTypes.getActualType(ForwardingResolvedTypes.java:73)


I'm calling this via "return typeResolver.resolveTypes( x ).getActualType( x );"

This is really weird because the annotation is already added to the JvmField and there is absolutely no need to add them again. Also I'm just want to get the already resolved type. Why the heck is the annotation added again then to something which throws an exception.

Is this a bug? I assume just removing the exception throw and everything will work fine...
Re: Cannot root twice [message #1721624 is a reply to message #1721621] Thu, 28 January 2016 17:15 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14075
Registered: July 2009
Senior Member
Can you Share a small example reproducing the problem

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Reference to static field instances
Next Topic:Getting all values under a category
Goto Forum:
  


Current Time: Mon Oct 18 11:08:17 GMT 2021

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

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

Back to the top