1
votes

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?

3
What do you have in \src\java directory? Are they empty? - Jean Barmash
No, it isn't empty. src\java contains the following .groovy files: BootStrap, Config, DataSource, Quote, QuoteController, QuoteControllerTests, QuoteService, QuoteServiceIntegrationTests, QuoteServicetests, QuoteTests and UrlMappings. Do I need to clear this out? - Andrew Whitehouse

3 Answers

2
votes

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.

5
votes

I understood your problem. The solution is just modify the grails vesion to 1.2.0 in application.properties file in your application

0
votes

You can upgrade grails version with 5 steps

  1. Project -> Clean
  2. application.properties -> Change app.grails.version
  3. Your project -> Properties -> Grails -> Change grails installation to new grails version.
  4. Your project -> Grails tools -> Refresh Dependencies

I think this may be help you