You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from {{mongodb-1.0.0.GA}} to {{mongodb-1.1.0.GA}}, a number of existing services broke. I discovered the bug was triggered by services proving a method named {{find()}}. If a service method makes a call to the same service's {{find()}} method, the following exception is produced:
{code}
| groovy.lang.MissingMethodException: No signature of method: mongodb.service.find.bug.ProductService.whereLazy() is applicable for argument types: () values: []
at mongodb.service.find.bug.ProductService.willCallFindMethod(BookServiceSpec.groovy:40)
at mongodb.service.find.bug.BookServiceSpec.Test that services can call local find method(BookServiceSpec.groovy:25)
{code}
I can confirm that downgrading to {{mongodb 1.0.0.GA}} works around the issue.
I have attached a sample Grails project which demonstrates this. The Grails demo project contains a single Spock unit test to reproduce the bug. For simplicity, I have appended a copy of the unit test below. This unit test will pass with {{mongodb-1.0.0.GA}}, but fail with {{mongo-1.1.0.GA}}. The missing method exception will be thrown when calling {{bookService.willCallFindMethod()}}
{code}
class BookServiceSpec extends spock.lang.Specification {
void "Test that services can call local find method"() {
BookService bookService = new BookService()
boolean success = false
when:"A service method's find() method is called directly"
success = bookService.find()
then:"The service is called correctly"
success == true
when:"A service method does not call the service's find() method"
success = bookService.willNotCallFindMethod()
then:"The service is called correctly"
success == true
when:"A service method calls the service's find() method"
success = bookService.willCallFindMethod()
then:"The service is called correctly"
success == true
}
}
class BookService {
def willNotCallFindMethod() {
return true
}
def willCallFindMethod() {
// TODO: If the bug exists, this will cause a MissingMethodException
// should we catch the exception and return false in this case
// ...or let the exception bubble up?
find()
return true
}
def find() {
return true
}
}
{code}
The text was updated successfully, but these errors were encountered:
Original Reporter: mjpowersjr
Environment: jdk 1.6.x, Ubuntu 12.10, Grails 2.1.1
Version: 1.1.0.GA
Migrated From: http:https://jira.grails.org/browse/GPMONGODB-263
After upgrading from {{mongodb-1.0.0.GA}} to {{mongodb-1.1.0.GA}}, a number of existing services broke. I discovered the bug was triggered by services proving a method named {{find()}}. If a service method makes a call to the same service's {{find()}} method, the following exception is produced:
{code}
| groovy.lang.MissingMethodException: No signature of method: mongodb.service.find.bug.ProductService.whereLazy() is applicable for argument types: () values: []
at mongodb.service.find.bug.ProductService.willCallFindMethod(BookServiceSpec.groovy:40)
at mongodb.service.find.bug.BookServiceSpec.Test that services can call local find method(BookServiceSpec.groovy:25)
{code}
I can confirm that downgrading to {{mongodb 1.0.0.GA}} works around the issue.
I have attached a sample Grails project which demonstrates this. The Grails demo project contains a single Spock unit test to reproduce the bug. For simplicity, I have appended a copy of the unit test below. This unit test will pass with {{mongodb-1.0.0.GA}}, but fail with {{mongo-1.1.0.GA}}. The missing method exception will be thrown when calling {{bookService.willCallFindMethod()}}
{code}
class BookServiceSpec extends spock.lang.Specification {
}
class BookService {
}
{code}
The text was updated successfully, but these errors were encountered: