tags:

views:

598

answers:

1

I have an example Grails application (from Grails in Action) that was created a while ago under version 1.1.1 on a different PC.

I am now loading Grails 1.2.0 and want to revisit the app. However, when I try to run it I get this message:

Application expects grails version [1.1.1], but GRAILS_HOME is version [1.2.0] - use the correct Grails version or run 'grails upgrade' if this Grails version is newer than the version your application expects.

After reading around a bit I cleared out the 1.2.0 folder under .grails in my home directory (from previous attempts while exploring the issue), ran "grails clean" and "grails upgrade" (answering "y" where prompted).

However, I consistently get "Invalid duplicate class definition" conflicts between classes in \grails\qotd\src\java and \grails\qotd\grails-app{controllers,services,conf}.

Are there any additional manual steps that I need to perform?

A: 

If, as you pointed out in the comments, your /src/java contains .groovy files - that could definitely cause unexpected behavior. I haven't hit your particular issue, but any time I had a .groovy file mismatched with the class name inside it, I'd get strange compilation issues - so I guess you could be having a similar issue.

If you have files / classes with the same names in two locations, that's the likely culprit. If you have .groovy files in /src/java, that's another potential source.

Also, putting BootStrap, Config, DataSource and URLMappings into /src/java, that's another potential source of issues. I'd clear out your /src/java by making sure all the files are in their appropriate places under grails-app.

Jean Barmash
After Jean's comment on the question I tried clearing out src/java and it fixed the issue.
Andrew Whitehouse