Skip to content

GPMONGODB-26: Dynamic finders fails with NPE #526

@graemerocher

Description

@graemerocher

Original Reporter: alari
Environment: M5, 1.3.7
Version: 1.0.0-M5
Migrated From: http://jira.grails.org/browse/GPMONGODB-26

  1. grails create-app
  2. remove hibernate, add mongo
  3. create any domain with a String property
  4. try to call ProbeDomain.findByTest("%") in tests
    5.

N/A
java.lang.NullPointerException
at org.grails.datastore.gorm.finders.FindByFinder.invokeQuery(FindByFinder.java:52)
at org.grails.datastore.gorm.finders.FindByFinder$1.doInSession(FindByFinder.java:44)
at org.grails.datastore.gorm.finders.AbstractFinder.execute(AbstractFinder.java:41)
at org.grails.datastore.gorm.finders.FindByFinder.doInvokeInternal(FindByFinder.java:41)
at org.grails.datastore.gorm.finders.DynamicFinder.invoke(DynamicFinder.java:137)
at org.grails.datastore.gorm.finders.DynamicFinder.invoke(DynamicFinder.java:284)
at org.grails.datastore.gorm.finders.FinderMethod$invoke.call(Unknown Source)
at org.grails.datastore.gorm.GormStaticApi.methodMissing(GormStaticApi.groovy:92)
at org.grails.datastore.gorm.StaticMethodInvokingClosure.call(GormEnhancer.groovy:245)
at mongo.m5.ProbeTests.testFind(ProbeTests.groovy:15)
at TestApp$_run_closure4.doCall(TestApp:271)
at TestApp$_run_closure4.call(TestApp)
at TestApp$_run_closure2.doCall(TestApp:228)
at TestApp$_run_closure1_closure21.doCall(TestApp:187)
at TestApp$_run_closure1.doCall(TestApp:174)
at TestApp$_run_closure1.doCall(TestApp.groovy:82)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)

It's not the only NPE I've cought, using this (clear) test or old tests which I wrote several monthes ago waiting for Mongo plugin to be production-ready.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions