poiati / gmongo

A Groovy wrapper to the mongodb Java driver
http://blog.paulopoiati.com/2010/06/20/gmongo-0-5-released/
Apache License 2.0
182 stars 44 forks source link

problem updating to gmongo-0.9.3 #8

Closed computorist closed 12 years ago

computorist commented 12 years ago

I use gmongo within a grails app and I tried bumping to v0.9.3 and ran into this error when trying to startup. I didn't see anything upgrade notes in the commit log. Is there something I need to update?

Thanks for a great library btw

2012-01-23 16:13:46,817 [Thread-8] ERROR context.GrailsContextLoader - Error executing bootstraps: groovy.lang.MissingMethodException: No signature of method: static com.gmongo.internal.MirrorObjectMutation.copyGeneratedId() is applicable for argument types: (com.brightcove.reporting.Domain, com.brightcove.reporting.Domain) values: [com.brightcove.reporting.Domain : null, ...] Possible solutions: copyGeneratedId([Ljava.lang.Object;, [Ljava.lang.Object;), copyGeneratedId(java.util.List, java.util.List), copyGeneratedId(java.util.Map, java.util.Map) org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: static com.gmongo.internal.MirrorObjectMutation.copyGeneratedId() is applicable for argument types: (com.brightcove.reporting.Domain, com.brightcove.reporting.Domain) values: [com.brightcove.reporting.Domain : null, ...] Possible solutions: copyGeneratedId([Ljava.lang.Object;, [Ljava.lang.Object;), copyGeneratedId(java.util.List, java.util.List), copyGeneratedId(java.util.Map, java.util.Map) at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:290) at grails.util.Environment.executeForEnvironment(Environment.java:283) at grails.util.Environment.executeForCurrentEnvironment(Environment.java:259) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: groovy.lang.MissingMethodException: No signature of method: static com.gmongo.internal.MirrorObjectMutation.copyGeneratedId() is applicable for argument types: (com.brightcove.reporting.Domain, com.brightcove.reporting.Domain) values: [com.brightcove.reporting.Domain : null, ...] Possible solutions: copyGeneratedId([Ljava.lang.Object;, [Ljava.lang.Object;), copyGeneratedId(java.util.List, java.util.List), copyGeneratedId(java.util.Map, java.util.Map) at com.gmongo.internal.DBCollectionPatcher$clinitclosure3.doCall(DBCollectionPatcher.groovy:41) at com.gmongo.internal.Patcher._invoke(Patcher.groovy:50) at com.gmongo.internal.Patcher$__patchInternal_closure1.doCall(Patcher.groovy:38) at com.brightcove.reporting.DomainService.save(DomainService.groovy:48) at com.brightcove.reporting.DomainService.demoData(DomainService.groovy:136) at BootStrap$_closure1.doCall(BootStrap.groovy:14) ... 8 more

poiati commented 12 years ago

Hello computorist,

Wich version of Groovy are you running? Version 0.9.3 requires 1.8.x, the last one is the recommended.

computorist commented 12 years ago

Version 1.8.5

poiati commented 12 years ago

com.brightcove.reporting.Domain is one of your domain classes? I think it's a incompatibility with Grails MongoDB Plugin, are you running Grails 1.3.x or 2.0? And wich version of the plugin?

Tks for the feedback!

computorist commented 12 years ago

Grails 2.0.0

I'm not using gorm. Using gmongo directly. Could this problem arise because Domain extends ReflectionDBObject? This Domain class is working fine with gmongo-0.9.2.

Everything is working with 0.9.2. I just like to keep up with latest stable versions of dependencies.

poiati commented 12 years ago

I see, probably that is the cause. Your domain classes are Groovy or Java classes? I tried to extend the ReflectionDBObject in a groovy class but it didn't work because of the groovy.lang.GroovyObject#getProperty method. Can you give an example?

Thanks.

poiati commented 12 years ago

Well, I will close this. Groovy / GMongo does not support ReflectionDBObject and in my opinion there is no point to support it.

computorist commented 12 years ago

That's fine. Please note though that groovy certainly supports ReflectionDBObject and GMongo did support it fine as of v0.9.2.

I'll try and find time to track down the incompatibility and send a pull request.

poiati commented 12 years ago

Ok, I appreciate your support.

Can you tell me if you Domain classes are written in Java?

Thanks!

computorist commented 12 years ago

No, pure grails/groovy project.