Grails
  1. Grails
  2. GRAILS-7757

Grails 1.1.1 -> 2.0.0 Upgrade problems

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-M1
    • Fix Version/s: 2.0-M1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Java 1.6.0_26, win7 64-bit.

      Description

      Ref: http://grails.1312388.n4.nabble.com/Grails-1-1-1-gt-2-0-0-Upgrade-problems-td3664807.html#a3673624

      I just copied my app, did grails clean, grails upgrade and grails run-app.

      For every controller I get an error about hasErrors() and for every domain I get a similar error for validate().

      I have tried doing grails clean after; no improvement.
      I have also tried removing ~/.Grails/

      {2.0.0.BUILD-SNAPSHOT, .slcache}

      ; also no effect.

      Controllers and domains are very simple, for example this domain:

      class Help {
      	
         String page
         String comment
      
         static constraints = { 
            page (blank:false,unique:true)
            comment (blank:false,size:0..100096)
         }
      }
      

      Gives:

      C:\DEVELOPMENT\Upgrade\grails-app\domain\Note.groovy: -1: The return type of boolean validate() in Note is incompatible with java.lang.Boolean validate() in java.lang.Object. At [-1:-1]  @ line -1, column -1.
      

      Path/Version info is at the end of the excerpted error listing.

      If I copy the files to a new 2.0.0 project I do not see these errors.

      Don't have anything untoward in WEB-INF/lib, my lib has iText-2.0.8.jar, mysql-connector-java-5.0.8-bin.jar.

      Don't see anyting in

      {Boostrap,Config}

      .groovy that would cause problems...just creating a couple of app-unique configuration variables (directory paths, that sort of thing, like "MyApp.StuffDevelopmentDir = 'C:\\TEMP\\stuff
      '").

      C:\DEVELOPMENT\Upgrade>grails run-app
      | Compiling 48 source files
       
      | Compiling 104 source files.
      | Error Compilation error: startup failed:
      C:\DEVELOPMENT\Upgrade\grails-app\controllers\AgreementController.groovy: -1: Th
      e return type of boolean hasErrors() in AgreementController is incompatible with
      java.lang.Boolean hasErrors() in java.lang.Object
      . At [-1:-1]  @ line -1, column -1.
      C:\DEVELOPMENT\Upgrade\grails-app\controllers\BaseController.groovy: -1: The ret
      urn type of boolean hasErrors() in BaseController is incompatible with java.lang
      .Boolean hasErrors() in java.lang.Object
      . At [-1:-1]  @ line -1, column -1.
       
      [...snip...]
       
      C:\DEVELOPMENT\Upgrade\grails-app\controllers\WarehouseController.groovy: -1: Th
      e return type of boolean hasErrors() in WarehouseController is incompatible with
      java.lang.Boolean hasErrors() in java.lang.Object
      . At [-1:-1]  @ line -1, column -1.
      C:\DEVELOPMENT\Upgrade\grails-app\controllers\ZipController.groovy: -1: The retu
      rn type of boolean hasErrors() in ZipController is incompatible with java.lang.B
      oolean hasErrors() in java.lang.Object
      . At [-1:-1]  @ line -1, column -1.
      C:\DEVELOPMENT\Upgrade\grails-app\domain\Agreement.groovy: -1: The return type o
      f boolean validate() in Agreement is incompatible with java.lang.Boolean validat
      e() in java.lang.Object
      . At [-1:-1]  @ line -1, column -1.
      C:\DEVELOPMENT\Upgrade\grails-app\domain\Board.groovy: -1: The return type of bo
      olean validate() in Board is incompatible with java.lang.Boolean validate() in j
      ava.lang.Object
      . At [-1:-1]  @ line -1, column -1.
       
      [...snip...]
       
      C:\DEVELOPMENT\Upgrade\grails-app\domain\StockTransfer.groovy: -1: The return ty
      pe of boolean validate() in StockTransfer is incompatible with java.lang.Boolean
      validate() in java.lang.Object
      . At [-1:-1]  @ line -1, column -1.
      C:\DEVELOPMENT\Upgrade\grails-app\domain\Warehouse.groovy: -1: The return type o
      f boolean validate() in Warehouse is incompatible with java.lang.Boolean validat
      e() in java.lang.Object
      . At [-1:-1]  @ line -1, column -1.
      66 errors
      
      C:\DEVELOPMENT\Upgrade>grails -version
       
      Grails version: 2.0.0.BUILD-SNAPSHOT
      C:\DEVELOPMENT\Upgrade>java -version
      java version "1.6.0_26"
      Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
      Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
      
      C:\DEVELOPMENT\Upgrade>groovy -version
      'groovy' is not recognized as an internal or external command,
      operable program or batch file.
      
      C:\DEVELOPMENT\Upgrade>path
      PATH=C:\DEVTOOLS\grails-2.0.0.BUILD-SNAPSHOT\BIN;C:\Progra~1\Java\jdk1.6.0_26\BI
      N;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x
      86;C:\DEVTOOLS\Oracle\OraXE\app\oracle\product\11.2.0\server\bin;;C:\Windows\sys
      tem32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\
      v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Fil
      es (x86)\QuickTime\QTSystem\;C:\BIN\gnuwin32\bin;C:\Users\Bob\AppData\Local\VanD
      yke Software\Clients\
       
      C:\DEVELOPMENT\Upgrade>
      

        Activity

        Hide
        Paulo Pires added a comment -

        I'm upgrading from 1.3.7 and I'm having the same issue with 2.0.0-M2. Any hints?

        Show
        Paulo Pires added a comment - I'm upgrading from 1.3.7 and I'm having the same issue with 2.0.0-M2. Any hints?
        Hide
        alpheratz added a comment -

        Take a look at the nabble conversation referred to in the original report.

        MY solution was to recreate the project.

        Show
        alpheratz added a comment - Take a look at the nabble conversation referred to in the original report. MY solution was to recreate the project.
        Hide
        Aaron Long added a comment -

        I'm having this issue on a project that was upgraded from 2.0.0M1 to M2. It didn't happen at first, but after a recent commit that seems completely unrelated I get:

        Error Compilation error: startup failed:
        /Users/longwa/github/endor/grails-app/domain/com/sojo/model/User.groovy: -1: The return type of java.lang.Boolean validate(java.util.List) in com.sojo.model.User is incompatible with boolean validate(java.util.List) in com.sojo.model.SiteUser
        . At [-1:-1] @ line -1, column -1.

        I've tried deleting my .grails caches with no luck.

        Show
        Aaron Long added a comment - I'm having this issue on a project that was upgraded from 2.0.0M1 to M2. It didn't happen at first, but after a recent commit that seems completely unrelated I get: Error Compilation error: startup failed: /Users/longwa/github/endor/grails-app/domain/com/sojo/model/User.groovy: -1: The return type of java.lang.Boolean validate(java.util.List) in com.sojo.model.User is incompatible with boolean validate(java.util.List) in com.sojo.model.SiteUser . At [-1:-1] @ line -1, column -1. I've tried deleting my .grails caches with no luck.
        Hide
        Aaron Long added a comment -

        My problem does NOT seem to be resolved by creating a new project. I also downloaded and built the latest dev snapshot and it still fails with the same error. In my example, I have nothing but basic constraints on both the User and SiteUser (User extends SiteUser, SiteUser is the s2-quickstart generated class). Neither class overrides or defines a validate() method.

        Show
        Aaron Long added a comment - My problem does NOT seem to be resolved by creating a new project. I also downloaded and built the latest dev snapshot and it still fails with the same error. In my example, I have nothing but basic constraints on both the User and SiteUser (User extends SiteUser, SiteUser is the s2-quickstart generated class). Neither class overrides or defines a validate() method.

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            alpheratz
          • Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development