I'd like to be able to use Hibernate and MongoDB in the same application, defining 2 datasources. I've added the following to BuildConfig:
compile ":mongodb:1.3.1"
When I try and do grails compile, I get the following:
| Installing zip mongodb-1.3.1.zip...
| Installing zip mongodb-1.3.1.zip....
| Installing zip mongodb-1.3.1.zip.....
| Installed plugin mongodb-1.3.1
| Installed plugin mongodb-1.3.1.
| Installed plugin mongodb-1.3.1..
| Installed plugin mongodb-1.3.1...
| Installed plugin mongodb-1.3.1....
| Installed plugin mongodb-1.3.1.....
| Error Fatal error during compilation org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/Users/gdboling/.grails/ivy-cache/org.grails/grails-hibernate/jars/grails-hibernate-2.2.4.jar!/org/codehaus/groovy/grails/compiler/gorm/GormTransformer.class]; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/type/classreading/AnnotationMetadataReadingVisitor (Use --stacktrace to see the full trace)
The docs for the MongoDB plugin say this is possible, but I'm not sure why I'm getting this compile error simply after adding the MongoDB plugin to the BuildConfig.
UPDATE:
After doing some more googling, it looks like it might be a version conflict with what the mongodb plugin is trying to use vs what our version of Grails (2.2.4) is using. Not quite sure how to resolve or track this down though.
Found this on the mailing list:
Downgraded from MongoDB plugin version 1.3.1 to 1.3.0 and now things seem fine.