or in namedQueries in Grails 2.3.8: AbstractMethod

2019-03-06 11:26发布

After upgrading from Grails 2.2.4 to 2.3.8 I'm getting

java.lang.AbstractMethodError: grails.orm.HibernateCriteriaBuilder.or(Lgroovy/lang/Closure;)Lorg/grails/datastore/mapping/query/api/Criteria;

in a query

class Trip {
    TripParticipant driver, passenger

    static namedQueries = {
        byParticipant { UserAccount ua, name = null ->
            or {
                for( n in ( name ? [ name ] : [ 'driver', 'passenger' ] ) ) {
                    eq "${n}.account", ua
                }
            }
        }  
    }
}

class TripParticipant {
    UserAccount account

    boolean rated = false
}

any ideas?

TIA

UPDATE

http://www.file-upload.net/download-8906460/dependency-report.txt.html is the output of dependency-report

标签: grails gorm
2条回答
做个烂人
2楼-- · 2019-03-06 12:02

I found the problem.

when I downdraded mongo-db plugin from

compile ':mongodb:3.0.1'

to

compile ':mongodb:3.0.0'

it worked like charm again.

查看更多
劳资没心,怎么记你
3楼-- · 2019-03-06 12:14

Rather than downgrade mongodb try and upgrade the version of hibernate you are using to the latest version to make sure the 2 project’s dependencies are in sync

查看更多
登录 后发表回答