Grails app domain class static mapping displays unknown compilation error
Hello All, I am developing a Grails app that is using static mapping to define so-called derived properties. As a result IDEA displays the domain class name w/ the distinctive squigly red underlining. The mouse over displays the following error condition:
There is a synthetic class 'com.xyz.MyDomain' generated for script code
Googling for this issue reveals no interesting ideas.
The stacktrace.log reveals no interesting information.
Please advise, David.
Please sign in to leave a comment.
I've got this same problem, but instead of no results on Google, this was the only one :). Did you make any progress since 2 years ago? Do you remember how you fixed it, if you did?
EDIT:
Well, I simply restarted IntelliJ and the problem went away... odd.
I just encountered this problem and this was still the only Google hit.
It turns out that I had a malformed class due to a couple of extraneous characters after the closing brace.
Hopefully this helps somebody in the future.
Though this is very old, still encouter similar errors, even with new version.
Seems like the grails app takes lot of time to be sync with Idea.
- Close Idea
- run grails clean, grails compile
- Start Idea, delete and reimport the import files.
Seems to have fixed the problem.
I did not have to restart IntelliJ or clean anything, I simply had a missing brace and IntelliJ gave me this cryptic error.
All my integration test had that error message after upgrading from Grails 2.5.1 to 3.2.4. The upgrade includes moving the integration test from test/integration to src/integration-test. IntelliJ 2016.3.4 would not recognize the classes as test classes. Changing my imports fixed the problem.
Old:
I too had this error message. Mine, also, was caused by a compilation error in the file.