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.

6 comments
Comment actions Permalink

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.

0
Comment actions Permalink

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.

0
Comment actions Permalink

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.

0
Comment actions Permalink

I did not have to restart IntelliJ or clean anything, I simply had a missing brace and IntelliJ gave me this cryptic error.

0
Comment actions Permalink

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: 

import grails.test.mixin.Mock
import grails.test.mixin.TestFor
import grails.test.mixin.integration.Integration
import spock.lang.Specification

New:
import grails.test.mixin.Mock
import grails.test.mixin.integration.Integration
import grails.transaction.*
import spock.lang.*
0
Comment actions Permalink

I too had this error message. Mine, also, was caused by a compilation error in the file. 

0

Please sign in to leave a comment.