Easygrid icon indicating copy to clipboard operation
Easygrid copied to clipboard

NullPointerException around line 242 of grails-app\services\org\grails\plugin\easygrid\datasource\GormDatasourceService.groovy

Open rerlinger opened this issue 10 years ago • 2 comments

Hi!

I'm always getting a NullPointerException by line 242 of GormDatasourceService.groovy. It seems that the baseCriteria.buildCriteria causes this issue in the current version:

    def createWhereQuery(GridConfig gridConfig, Filters filters, List orderBy = [], boolean countRows = false) {
//        DetachedCriteria baseCriteria = new DetachedCriteria(gridConfig.domainClass)
        def baseCriteria = gridConfig.domainClass.createCriteria()
        baseCriteria.buildCriteria {
            if (gridConfig.initialCriteria) {

I'm using Easygrid with MongoDB, here is my current plugin config:

    plugins {
        // plugins for the build system only
        build ":tomcat:7.0.52.1"

        // plugins for the compile step
        compile ":scaffolding:2.1.2"
        compile ":cache:1.1.8"
        compile ":mongodb:3.0.2"
        compile ":gson:1.1.4"
        compile ":joda-time:1.5"

        // plugins needed at runtime but not for compilation
        runtime ":database-migration:1.4.0"

        // EasyGrid plugin http://grails.org/plugin/easygrid
        compile ":easygrid:1.6.8"

        // For minimum functionality you need: jquery-ui and the export plugins.
        // Export Plugin http://grails.org/plugin/export
        compile ":export:1.6"
        compile ":asset-pipeline:1.9.9"
        compile ":jquery:1.11.1"
        compile ":jquery-ui:1.10.4"

        // For google visualization you also need google-visualization
        // Google Visualization API Plugin http://grails.org/plugin/google-visualization
        compile ":google-visualization:0.7"
    }
}

Thank you for every help!

Best regards, Robert

rerlinger avatar Nov 13 '14 20:11 rerlinger

Hi Robert,

The GormDatasourceService is not actually named properly. It should actually be called HibernateDatasourceService because it uses HibernateCriteriaBuilder.

Initially I was using DetachedCriteria but there was a bug so I changed the implementation. That bug was fixed in the last version of Grails, so I will release a Datasource which should work with Mongo very soon.

tudor-malene avatar Nov 13 '14 23:11 tudor-malene

Hi Tudor!

Ok, thank you

br, Robert

rerlinger avatar Nov 14 '14 09:11 rerlinger