Quantcast

Project won't compile when creating custom Annotation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Project won't compile when creating custom Annotation

Eric Ettes
Hi all,

I have a strange problem whenever I try to create a custom annotation. Whenever I create an empty annotation like this:

public @interface SearchField {

}

and try to run my app, it won't compile with a lot of errors:

| Error Compilation error: startup failed:
/Users/eric/Documents/IntelliJ IDEA/App/grails-app/domain/nl/app/annotation/SearchField.groovy: -1: Method 'initErrors' is private but should be public in interface 'nl.app.annotation.SearchField'.
 @ line -1, column -1.
.
. ^ About 50 of those lines for different fields/methods
.
General error during class generation: org.codehaus.groovy.ast.stmt.BlockStatement cannot be cast to org.codehaus.groovy.ast.stmt.ReturnStatement


The weird thing is that it does work for a colleague of mine.

I'm running java version "1.6.0_33" on OSX 10.7.4 and the app is using Grails 2.0.4

My colleague is running java version "1.7.0_3" on Windows 7, also using Grails 2.0.4


Is anyone experiencing the same problems and/or has anyone found a solution to this?

Kind regards,

-- 
Eric Ettes
Sent with Sparrow

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Project won't compile when creating custom Annotation

Ian Roberts
On 22/06/2012 10:36, Eric Ettes wrote:
> | Error Compilation error: startup failed:
> /Users/eric/Documents/IntelliJ
> IDEA/App/grails-app/domain/nl/app/annotation/SearchField.groovy: -1:
> Method 'initErrors' is private but should be public in interface
> 'nl.app.annotation.SearchField'.
>  @ line -1, column -1.

Put the annotation type in src/groovy or src/java instead of
grails-app/domain.

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...