Skip to content

Trying to use generated scaffolding causes error #16

@gkrasnow

Description

@gkrasnow

| Error 2012-12-11 17:58:19,705 [http-bio-8090-exec-10] ERROR mongodb.MongoDomainClass - Could not get instance from DB
Message: invalid ObjectId [null]
Line | Method
->> 128 | in org.bson.types.ObjectId


| 122 | in ''
| 554 | _checkedId . . . in grails.plugins.mongodb.MongoPluginSupport
| 240 | doCall in grails.plugins.mongodb.MongoPluginSupport$_addStaticMethods_closure13
| 34 | show . . . . . . in mongotest.DummyBController
| 195 | doFilter in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter . . . . in grails.plugin.cache.web.filter.AbstractFilter
| 46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter
| 886 | runTask . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 680 | run . . . . . . in java.lang.Thread

package mongotest

import com.google.code.morphia.annotations.Entity
import grails.plugins.mongodb.ast.TransformationConfiguration

@Entity
@TransformationConfiguration(injectId = true, injectVersion = true)
class DummyB {
    transient mongo // spring bean, dependency injection

    String b
    Date dateCreated
    Date lastUpdated

    static constraints = {
        b nullable: false
    }

    def validate() {
        return true;
    }

    String toString() {
        'DummyB: ' + id + '::' + b
    }
}

There is a dummy validate() function to work around the previous issue I submitted where the validate() function is not found on the domain objects.

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