or in namedQueries in Grails 2.3.8: AbstractMethodError

人盡茶涼 提交于 2019-12-31 05:48:10

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/23581133/or-in-namedqueries-in-grails-2-3-8-abstractmethoderror

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!