Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext 2.12 migration issue (ComputationExceptionStackOverflow)(Updating to Guice 4)
Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1769595] Wed, 02 August 2017 02:26 Go to next message
Eclipse UserFriend
Hi All,

After migrating to latest Xtext/Java 8, I stumbled across the attached error. I cannot make any more progress.

Almost everyone facing this problem [0] recommend [1] updating to Guice 4. I understand that there is already an issue raised [2], however I would like to know if there are immediate plans of updating Guice.

[0] https://github.com/google/guice/issues/681
[1] https://goo.gl/uo79wJ
[2] https://github.com/eclipse/xtext-core/issues/393

Please comment.

Tx in advance.
  • Attachment: err.txt
    (Size: 19.51KB, Downloaded 95 times)
Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1769597 is a reply to message #1769595] Wed, 02 August 2017 02:33 Go to previous messageGo to next message
Eclipse UserFriend
if i understand that you will get only better error messages with guice4
from which xtext version are you migrating?
did you try to use the debugger to find out what binding causes the stackoverflow?
do you use xbase or not?

does this happen with ui module only or with standlone as well?

do you use the new xtext generator (2.9+) or still the old workflow.

could you share a minimal reproducing project

can you diff the generated abstract modules with the new and the old version. are there any diffs?

[Updated on: Wed, 02 August 2017 02:43] by Moderator

Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1769601 is a reply to message #1769597] Wed, 02 August 2017 03:34 Go to previous messageGo to next message
Eclipse UserFriend
> if i understand that you will get only better error messages with guice4
Right, for better error message.

> from which xtext version are you migrating?
Migrating from 2.8 to 2.12.

> did you try to use the debugger to find out what binding causes the stackoverflow?
I put breakpoints on "ComputationException" and "StackOverflowError" and thought of tracing back to find the types that Guice is trying to build/bind, but the debugger gets stuck/stops responding (PS attached image). Is there a better place to put the breakpoint(s) ?

> do you use xbase or not?
Yes, with quiet a bit of customization's.

> does this happen with ui module only or with standlone as well?
It happens with the standalone projects. I haven't tested it with the UI module as I do not need it at this moment.

> do you use the new xtext generator (2.9+) or still the old workflow.
Yes I am using the new Xtext generator. With the old workflow, we have some issues with the customizations that we have done to the XBase compiler and other pieces.

> could you share a minimal reproducing project
I'll try to come up with a minimal example. The one where I see the errors cannot be shared.

> can you diff the generated abstract modules with the new and the old version. are there any diffs?
Yes there were many differences, especially in the generated code.
  • Attachment: 037.png
    (Size: 11.53KB, Downloaded 101 times)
Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1769603 is a reply to message #1769601] Wed, 02 August 2017 03:38 Go to previous messageGo to next message
Eclipse UserFriend
so the change that causes this could be in 2.9 2.10 and 2.11 as well.
Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1769606 is a reply to message #1769603] Wed, 02 August 2017 03:53 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, I cannot confirm as I haven't tried porting to 2.9 2.10 and 2.11.

Give the situation, do you have any hints/recommendations that I could try ? Something that can help me understand more about the actual problem. Tx

[Updated on: Wed, 02 August 2017 03:54] by Moderator

Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1769607 is a reply to message #1769606] Wed, 02 August 2017 03:58 Go to previous messageGo to next message
Eclipse UserFriend
well i think we need an example.
i wonder which is the JIT binding that is missing and that you could somehow see it in the debugger.
maybe you can do some sysouts in conditional breakpoints
and look whats printed right before the stackoverflow happens
Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1770255 is a reply to message #1769607] Wed, 09 August 2017 08:49 Go to previous messageGo to next message
Eclipse UserFriend
We have a bunch of DSL's in our product. I am experiencing the aforementioned issue in the ones that make use of XBase. This is what I found - In the new generated code (2.9+), the generated class AbstractMyDslRuntimeModule extends the DefaultRuntimeModule. In the old code (2.8) it was extending from the DefaultCommonTypesRuntimeModule. Now, in the new generated code, if I change the AbstractMyDslRuntimeModule to extend DefaultCommonTypesRuntimeModule, everything works fine. I no more see the ComputationExceptionStackOverflow error.

The class AbstractMyDslRuntimeModule is part of the "src-gen" folder and I shouldn't be changing it manually. Is there a way for me to generate the AbstractMyDslRuntimeModule that extends DefaultCommonTypesRuntimeModule ? I looked into the "XbaseGeneratorFragment2", but didn't find anything that could help. Any clue ???

PS : I create a sample DSL (based on XBase) using Xtext 2.8 and then ported (updated mwe2, regenerated code) to Xtext 2.12, but I couldn't reproduce the issue. It appears that the problem is with my office project and I might have overlooked something. Nevertheless, the above fix works.

Tx in advance.

[Updated on: Wed, 09 August 2017 09:11] by Moderator

Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1770261 is a reply to message #1770255] Wed, 09 August 2017 09:26 Go to previous messageGo to next message
Eclipse UserFriend
are you sure you inherit from xbase? or xtype? or teminals? how does the header of your lang look like? how the workflow?

[Updated on: Wed, 09 August 2017 09:45] by Moderator

Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1770277 is a reply to message #1770261] Wed, 09 August 2017 11:02 Go to previous messageGo to next message
Eclipse UserFriend
Correction - The language for which I see the error "does not" inherit from XBase. It does define a custom - JVMModelInferrer, ResourceDescriptionStrategy (extends XbaseResourceDescriptionStrategy) and bindings for the same. In addition, following bindings are provided - XbaseQualifiedNameProvider, JvmModelAssociator, BatchLinkableResource..etc

The workflow is quiet straightforward.
  • Attachment: mydsl.mwe2
    (Size: 1.90KB, Downloaded 94 times)
Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1770280 is a reply to message #1770277] Wed, 09 August 2017 11:11 Go to previous messageGo to next message
Eclipse UserFriend
would have expected a

commonTypesSupport = {
onlyEnabledIfGrammarIsUsed = false
}

inside the language section
Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1770283 is a reply to message #1770280] Wed, 09 August 2017 11:46 Go to previous messageGo to next message
Eclipse UserFriend
Very nice. It works now.

Thank you very much for the help.
Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1770358 is a reply to message #1770283] Thu, 10 August 2017 07:39 Go to previous messageGo to next message
Eclipse UserFriend
Hello Christian,

Sorry, I still have one last bit pending. Highly appreciate if I could get some hints.

The above works perfectly fine for the "standalone" modules. However, when I try the UI modules, I see the same error -ComputationExceptionStackOverflow.

In the DSL that uses XBase (with org.eclipse.xtext.xbase.Xbase), the AbstractXXDslIdeModule extends from the DefaultXbaseIdeModule. Based on what I saw above, I manually changed the AbstractMyDslIdeModule (non xbase) to extend DefaultXbaseIdeModule, but that didn't work.

I am not sure how to proceed. Do you have any clue ?

Tx in advance.

Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1770361 is a reply to message #1770358] Thu, 10 August 2017 08:02 Go to previous messageGo to next message
Eclipse UserFriend
can you simply compare the bindings in the abstract generated ui and ide module and their hardcodeded supertypes from a real xbase language with yours to find out whats missing?
i assume it has todo with some JIT bindings that rather need an explicit binding
Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1770363 is a reply to message #1770361] Thu, 10 August 2017 08:04 Go to previous messageGo to next message
Eclipse UserFriend
there is e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=467213
Re: Xtext 2.12 migration issue (ComputationExceptionStackOverflow) [message #1770364 is a reply to message #1770363] Thu, 10 August 2017 08:05 Go to previous message
Eclipse UserFriend
=> it would be nice to have a minimal reproducing example
Previous Topic:content assist
Next Topic:(newbie) Rule error on CrossReferences
Goto Forum:
  


Current Time: Wed Jul 23 08:20:42 EDT 2025

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

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

Back to the top