Issues with UUID with Grails, GORM and MongoDB -
i new grails , tried persist model id of type uuid. aware of there objectid persist uuid.
class book { uuid id string title }
i have bookcontroller have enabled scaffolding. when load controller , seek add together new book, next error message grails:
error 500: internal server error uri /grailstest/book/save class org.springframework.core.convert.converternotfoundexception message no converter found capable of converting type java.lang.string type java.util.uuid around line 24 of grails-app/controllers/ch/teamrg/test/bookcontroller.groovy around line 186 of pagefragmentcachingfilter.java 183: if(method == null) { 184: log.debug("no cacheable method found {}:{} {}", 185: new object[] { request.getmethod(), request.getrequesturi(), getcontext() }); 186: chain.dofilter(request, response); 187: return; 188: } 189: collection cacheoperations = cacheoperationsource.getcacheoperations( around line 63 of abstractfilter.java 60: seek { 61: // no_filter set requestdispatcher forwards avoid double gzipping 62: if (filternotdisabled(request)) { 63: dofilter(request, response, chain); 64: } 65: else { 66: chain.dofilter(req, res); trace line | method ->> 18 | convert in org.grails.datastore.mapping.model.types.conversion.defaultconversionservice - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 365 | cachenativeentry in org.grails.datastore.mapping.engine.nativeentryentitypersister | 725 | persistentity . in '' | 125 | persist in org.grails.datastore.mapping.engine.entitypersister | 479 | persist . . . . in org.grails.datastore.mapping.core.abstractsession | 166 | dosave in org.grails.datastore.gorm.gorminstanceapi | 143 | docall . . . . . in org.grails.datastore.gorm.gorminstanceapi$_save_closure4 | 301 | execute in org.grails.datastore.mapping.core.datastoreutils | 34 | execute . . . . in org.grails.datastore.gorm.abstractdatastoreapi | 142 | save in org.grails.datastore.gorm.gorminstanceapi | 258 | phone call . . . . . . in org.grails.datastore.gorm.instancemethodinvokingclosure | 24 | save in bookcontroller.groovy | 186 | dofilter . . . . in pagefragmentcachingfilter.java | 63 | dofilter in abstractfilter.java | 886 | runtask . . . . in java.util.concurrent.threadpoolexecutor$worker | 908 | run in '' ^ 680 | run . . . . . . in java.lang.threadi set breakpoint @ org.grails.datastore.mapping.engine.nativeentryentitypersister. when application gets there, can resolve getmappingcontext().getconversionservice() part returns instance of org.grails.datastore.mapping.model.types.conversion.defaultconversionservice. instance has 10 converters configured including converters objectid , binary. asking myself now, can configure own converter can convert between string , uuid?
as new grails have no clue set required java files , in file have set kind of configuration. cool if point me in right direction.
there's session in docs custom user types.
so need create type class extends abstractmappingawarecustomtypemarshaller
, register spring bean
(see in final of docs).
mongodb grails gorm
No comments:
Post a Comment