Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » xtext standalone builder via gradle failing to validate(Failing validation with xtext standalone builder)
xtext standalone builder via gradle failing to validate [message #1690963] Wed, 01 April 2015 10:19 Go to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
Hi,

In my grammar, its working great in Eclipse, cross-referencing works, validation works, but when I try to run it using the xtext standalone builder (using xtext gradle plugin) it failed with log excerpt at the foot of this post.

My question is has anyone experienced this and is there something I can do to help me debug it effectively?

I am not even sure if this is due to my scoping implementation, it seems to fail on a resource validator not finding cross references correctly which makes no sense since, it works in eclipse fine Sad

Any help would be massively appreciated.

11:03:41.202 [INFO] [org.eclipse.xtext.builder.standalone.StandaloneBuilder] Collecting source models.
11:03:41.226 [DEBUG] [org.eclipse.xtext.builder.standalone.StandaloneBuilder] Adding file 'file:/Users/ian.warwick/Documents/sdev/proj/justeat/app/app-data/src/main/model/justeat.init.mickey'
11:03:41.228 [DEBUG] [org.eclipse.xtext.mwe.PathTraverser] File under : /Users/ian.warwick/Documents/sdev/proj/justeat/app/app-data/src/test/java doesn't exist.
11:03:43.358 [DEBUG] [org.eclipse.xtext.builder.standalone.StandaloneBuilder] Finished collecting source models. Took: 2154 ms.
11:03:43.623 [DEBUG] [org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser] Parsing took: 49 ms
11:03:43.627 [DEBUG] [org.eclipse.xtext.linking.impl.AbstractCleaningLinker] beforeModelLinked took: 0ms
11:03:43.645 [DEBUG] [org.eclipse.xtext.linking.impl.AbstractCleaningLinker] doLinkModel took: 19ms
11:03:43.645 [DEBUG] [org.eclipse.xtext.linking.impl.AbstractCleaningLinker] afterModelLinked took: 0ms
11:03:43.657 [INFO] [org.eclipse.xtext.builder.standalone.StandaloneBuilder] Validate and generate.
11:03:43.660 [DEBUG] [org.eclipse.xtext.linking.impl.DefaultLinkingService] before getLinkedObjects: node: 'r'
11:03:43.695 [DEBUG] [org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider] No explicit container state set. Falling back to default.
11:03:43.697 [DEBUG] [org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider] No explicit container state set. Falling back to default.
11:03:43.697 [DEBUG] [org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider] No explicit container state set. Falling back to default.
11:03:43.723 [DEBUG] [org.eclipse.xtext.linking.impl.DefaultLinkingService] after getLinkedObjects: node: 'r' result: r
11:03:43.724 [DEBUG] [org.eclipse.xtext.linking.impl.DefaultLinkingService] before getLinkedObjects: node: '_id'
11:03:43.732 [DEBUG] [org.eclipse.xtext.linking.impl.DefaultLinkingService] after getLinkedObjects: node: '_id' result: null
11:03:43.735 [DEBUG] [org.eclipse.xtext.linking.impl.DefaultLinkingService] before getLinkedObjects: node: 'restaurants'
11:03:43.739 [DEBUG] [org.eclipse.xtext.linking.impl.DefaultLinkingService] after getLinkedObjects: node: 'restaurants' result: restaurants
11:03:43.740 [INFO] [org.eclipse.xtext.builder.standalone.StandaloneBuilder] Starting validation for input: 'justeat.init.mickey'
11:03:43.746 [DEBUG] [org.eclipse.xtext.validation.ResourceValidatorImpl] Syntax check FAIL! Resource: file:/Users/ian.warwick/Documents/sdev/proj/justeat/app/app-data/src/main/model/justeat.init.mickey
11:03:43.810 [ERROR] [org.eclipse.xtext.builder.standalone.IIssueHandler$DefaultIssueHandler] ERROR:Couldn't resolve reference to ColumnSource '_id'. (file:/Users/ian.warwick/Documents/sdev/proj/justeat/app/app-data/src/main/model/justeat.init.mickey line : 10)
11:03:43.811 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app-data:xtextGenerate'
11:03:43.811 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :app-data:xtextGenerate FAILED
11:03:43.812 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :app-data:xtextGenerate (Thread[Daemon worker,5,main]) completed. Took 6.368 secs.
11:03:43.813 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker,5,main]] finished, busy: 26.061 secs, idle: 0.151 secs
11:03:43.818 [ERROR] [org.gradle.BuildExceptionReporter] 
11:03:43.820 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:03:43.821 [ERROR] [org.gradle.BuildExceptionReporter] 
11:03:43.821 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
11:03:43.822 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':app-data:xtextGenerate'.
11:03:43.822 [ERROR] [org.gradle.BuildExceptionReporter] > Xtext generation failed
11:03:43.825 [ERROR] [org.gradle.BuildExceptionReporter] 
11:03:43.825 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
11:03:43.827 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app-data:xtextGenerate'.
11:03:43.828 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)

Re: xtext standalone builder via gradle failing to validate [message #1690964 is a reply to message #1690963] Wed, 01 April 2015 10:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14667
Registered: July 2009
Senior Member
Hi,

this should work fine. the basic error is: Couldn't resolve reference to ColumnSource '_id'.
where is the ColumnSource defined? in the same file?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: xtext standalone builder via gradle failing to validate [message #1690965 is a reply to message #1690964] Wed, 01 April 2015 10:24 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
Yes, in the same file, the same file cross references and opens without errors in eclipse, which is odd.
Re: xtext standalone builder via gradle failing to validate [message #1690966 is a reply to message #1690965] Wed, 01 April 2015 10:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14667
Registered: July 2009
Senior Member
Hi,

maybe there is something wrong with your scoping implementation.
does it work with a java main?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: xtext standalone builder via gradle failing to validate [message #1690967 is a reply to message #1690966] Wed, 01 April 2015 10:29 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
Thanks Christian will have to try that, good idea. Whats the best way to do that using a standard xtext project? I need to somehow run the standalone setup in isolation?
Re: xtext standalone builder via gradle failing to validate [message #1690968 is a reply to message #1690967] Wed, 01 April 2015 10:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14667
Registered: July 2009
Senior Member
Hi,

e.g. have a look at https://www.eclipse.org/forums/index.php/t/1065259/ or https://wiki.eclipse.org/Xtext/FAQ


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: xtext standalone builder via gradle failing to validate [message #1691127 is a reply to message #1690968] Thu, 02 April 2015 13:15 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
Cheers Christian, it was my scoping implementation, I had to to some funky stuff since my language implementation does to explicitly tie things together in a way that benefits cross referencing across files.

I am trying to get access to objects in the global index but this behaves differently in standalone mode.

files = resourceDescriptions.getExportedObjectsByType(MickeyLangPackage.Literals.MICKEY_FILE)
        .map[e|EcoreUtil.resolve(e.EObjectOrProxy, context) as MickeyFile].toList	 


Seems in standalone files does not aggregate all my MickeyFile objects in the same way it does in eclipse. Sad This code is being used within my custom scope provider

[Updated on: Thu, 02 April 2015 13:16]

Report message to a moderator

Re: xtext standalone builder via gradle failing to validate [message #1691131 is a reply to message #1691127] Thu, 02 April 2015 13:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14667
Registered: July 2009
Senior Member
Hi,

yes and no, standalone you have to add all relevant resource to the resourceset. but since it is in the same fine this holds true


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: xtext standalone builder via gradle failing to validate [message #1691134 is a reply to message #1691131] Thu, 02 April 2015 13:48 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
Ah cool, thing is I am trying to use the xtext gradle tooling which uses the xtext standalone builder so something is happening differently there to what it does with eclipse, I solved the problem by going through resource.eResourceSet instead to aggregate my MickeyFile objects for standalone but this does not work in eclipse due to the lazy linking (I think), so I have had to add a flag to know if its standalone, I use a different strategy to aggregate those resources.

Re: xtext standalone builder via gradle failing to validate [message #1691137 is a reply to message #1691134] Thu, 02 April 2015 13:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14667
Registered: July 2009
Senior Member
Hi,

it should work in both cases the same since indexing is done before scoping/linking.
thus all MICKEY_FILE should be in the index by then


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: xtext standalone builder via gradle failing to validate [message #1691139 is a reply to message #1691137] Thu, 02 April 2015 14:07 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
Ok cool, so what seems to be happening is the exception is coming from resolving the ecore objects

files = resourceDescriptions.getExportedObjectsByType(MickeyLangPackage.Literals.MICKEY_FILE)
        .map[e|EcoreUtil.resolve(e.EObjectOrProxy, context) as MickeyFile].toList


In EcoreUtil.resolve(e.EObjectOrProxy, context), so that might be trying to resolve references which conflict with my scope provider implementation before that statement completes to return the file objects, which does not happen in eclipse Sad
Re: xtext standalone builder via gradle failing to validate [message #1691141 is a reply to message #1691139] Thu, 02 April 2015 14:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14667
Registered: July 2009
Senior Member
And what is the exception?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: xtext standalone builder via gradle failing to validate [message #1691146 is a reply to message #1691141] Thu, 02 April 2015 14:46 Go to previous messageGo to next message
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
The result was the log I posted above, it was failing exactly on that line and going no further, it just failed to do the cross-reference linking.
Re: xtext standalone builder via gradle failing to validate [message #1691150 is a reply to message #1691146] Thu, 02 April 2015 14:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14667
Registered: July 2009
Senior Member
Hi strange. Can you create a minimal example that reproduces the problem?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: xtext standalone builder via gradle failing to validate [message #1709445 is a reply to message #1691150] Mon, 28 September 2015 13:02 Go to previous messageGo to next message
Hans-Peter Bantle is currently offline Hans-Peter BantleFriend
Messages: 5
Registered: September 2015
Junior Member
Hi Ian,

I'm facing exactly the same problem as described above. I'm using cross-project references in my dsl, which is working fine in Eclipse. But when trying to build it with gradle, the import seems to be ignored and I end up with errors like:

ERROR:Couldn't resolve reference to DomainType ...

Would you please elaborate a bit more on your solution with the custom scope provider? Thank you.
Re: xtext standalone builder via gradle failing to validate [message #1709794 is a reply to message #1709445] Thu, 01 October 2015 07:29 Go to previous messageGo to next message
Stefan Oehme is currently offline Stefan OehmeFriend
Messages: 159
Registered: April 2010
Location: Kiel
Senior Member

I think there is a problem in your scoping implementation, since the StandaloneBuilder will index all your files before linking/validation. So it should work the same as in Eclipse.

You can pass the
-Dorg.gradle.debug=true
flag to your build and then attach the Eclipse remote debugger to see what's wrong.

Edit:
Sorry, I just saw how old the original message is. I guess your problem is resolved by now, Ian?

[Updated on: Thu, 01 October 2015 07:31]

Report message to a moderator

Re: xtext standalone builder via gradle failing to validate [message #1709799 is a reply to message #1709794] Thu, 01 October 2015 07:48 Go to previous messageGo to next message
Hans-Peter Bantle is currently offline Hans-Peter BantleFriend
Messages: 5
Registered: September 2015
Junior Member
Problem is solved, thank you!
Re: xtext standalone builder via gradle failing to validate [message #1709801 is a reply to message #1709799] Thu, 01 October 2015 07:49 Go to previous message
Stefan Oehme is currently offline Stefan OehmeFriend
Messages: 159
Registered: April 2010
Location: Kiel
Senior Member

Sorry Hans, my answer was pointed at Ian, the original author of this post. I know your problem had another cause and was solved in a different post =)

Cheers,
Stefan
Previous Topic:Indexing outside of the buider
Next Topic:DefaultLastSegmentFinder.getLastSegment()
Goto Forum:
  


Current Time: Fri Apr 26 18:00:57 GMT 2024

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

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

Back to the top