Skip to content

GMongo enhancements fail when using invokeDynamic #22

@mathieucarbou

Description

@mathieucarbou

When I try to compile my groovy module with Maven using Java 8 and the new gmaven plugin with invokedynamic, my tests fails because GMongo cannot convert maps and list containing teh requests to DbObject.

Thus I am forced to disable invokeDynamic

        <plugin>
            <groupId>org.codehaus.gmavenplus</groupId>
            <artifactId>gmavenplus-plugin</artifactId>
            <configuration>
                <invokeDynamic>false</invokeDynamic>
            </configuration>
        </plugin>

If I enable it, I have the following error:

Caused by: java.lang.ClassCastException: java.util.HashMap cannot be cast to com.mongodb.DBObject
        at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:219)
        at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:204)
        at com.mongodb.DBCollection.insert(DBCollection.java:148)
        at com.mongodb.DBCollection.insert(DBCollection.java:133)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterf

I am using the Groovy 2.2.1 indy jar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions