Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error converting Bean with class org.grails.validation.ConstrainedDelegate #12

Open
Erando89 opened this issue Jan 7, 2019 · 1 comment

Comments

@Erando89
Copy link

Erando89 commented Jan 7, 2019

Hi,
I'm having a issue with Grails 3.3.9:
compile 'org.grails.plugins:converters:3.3.1' // Provides JSON and XML converters
In a gsp file I'd like to use someMap as JSON. But eventually I get this error:

Caused by: org.grails.web.converters.exceptions.ConverterException: Error converting Bean with class org.grails.validation.ConstrainedDelegate
	at org.grails.web.converters.marshaller.json.GroovyBeanMarshaller.marshalObject(GroovyBeanMarshaller.java:85)
	at org.grails.web.converters.marshaller.json.GroovyBeanMarshaller.marshalObject(GroovyBeanMarshaller.java:39)
	at grails.converters.JSON.value(JSON.java:184)
	at grails.converters.JSON.convertAnother(JSON.java:144)
	at org.grails.web.converters.marshaller.json.MapMarshaller.marshalObject(MapMarshaller.java:45)
	at org.grails.web.converters.marshaller.json.MapMarshaller.marshalObject(MapMarshaller.java:30)
	at grails.converters.JSON.value(JSON.java:184)
	at grails.converters.JSON.convertAnother(JSON.java:144)
	at org.grails.web.converters.marshaller.json.MapMarshaller.marshalObject(MapMarshaller.java:45)
	at org.grails.web.converters.marshaller.json.MapMarshaller.marshalObject(MapMarshaller.java:30)
	at grails.converters.JSON.value(JSON.java:184)
	at grails.converters.JSON.render(JSON.java:119)
	at org.grails.web.converters.AbstractConverter.writeTo(AbstractConverter.java:110)
	at org.grails.buffer.GrailsPrintWriter.writeWritable(GrailsPrintWriter.java:568)
	at org.grails.buffer.GrailsPrintWriter.print(GrailsPrintWriter.java:576)
	at sun.reflect.GeneratedMethodAccessor892.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1427)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:169)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
	at C__repo_grails_app_views_desktop__pass_model_to_js_desktop_inc_gsp.run(C__repo_grails_app_views_desktop__pass_model_to_js_desktop_inc_gsp:39)

The map I'm trying to convert looks like this

 itemsPerPage=20,
 isTablet=false,
 disableOption=[],
 enableOption=[],
 locationOnlyGiven=true,
 altRadius=35000,
 constraints=de.company.tb.input.SearchParams$__clinit__closure3@3b854469,
 ajaxSearch=false,
 stype=S,
 offset=0,
 f_ot=[],
 validRegionId=false,
 nationalSearch=true,
 regionSearch=false,
 constraintsMap={kw=org.grails.validation.ConstrainedDelegate@14464116,
 adkw=org.grails.validation.ConstrainedDelegate@6620e89f,
 kwToShow=org.grails.validation.ConstrainedDelegate@2ab948b9,
 br=org.grails.validation.ConstrainedDelegate@3b0ef78b,
 ci=org.grails.validation.ConstrainedDelegate@1de65f0d,
 ci_list=org.grails.validation.ConstrainedDelegate@7ce3283e,
 ci_pc=org.grails.validation.ConstrainedDelegate@1c7f5b9b,
 cidistrict=org.grails.validation.ConstrainedDelegate@50014530,
 ciid=org.grails.validation.ConstrainedDelegate@7f30760a,
 ciquarter=org.grails.validation.ConstrainedDelegate@1af7130a,
 rzId=org.grails.validation.ConstrainedDelegate@7cb2204c,
 fn=org.grails.validation.ConstrainedDelegate@2640c22f,
 kgs=org.grails.validation.ConstrainedDelegate@5abc70cb,
 lat=org.grails.validation.ConstrainedDelegate@78f147d5,
 lon=org.grails.validation.ConstrainedDelegate@15aca8c7,
 phone=org.grails.validation.ConstrainedDelegate@355d41e7,
 rgid=org.grails.validation.ConstrainedDelegate@c5e45af,
 radius=org.grails.validation.ConstrainedDelegate@7ee3741e,
 stype=org.grails.validation.ConstrainedDelegate@e791195,
 pc=org.grails.validation.ConstrainedDelegate@51742bc4,
 ac=org.grails.validation.ConstrainedDelegate@2f797f78,
 altCx=org.grails.validation.ConstrainedDelegate@4adfad0d,
 altCy=org.grails.validation.ConstrainedDelegate@c6ce87a,
 altRadius=org.grails.validation.ConstrainedDelegate@7c36c838,
 street=org.grails.validation.ConstrainedDelegate@18d0fa79,
 houseno=org.grails.validation.ConstrainedDelegate@2fd08bab,
 address=org.grails.validation.ConstrainedDelegate@44948913,
 biscope=org.grails.validation.ConstrainedDelegate@e29eeb1,
 topicCategories=org.grails.validation.ConstrainedDelegate@11b5de3f,
 enableOption=org.grails.validation.ConstrainedDelegate@3a139271,
 disableOption=org.grails.validation.ConstrainedDelegate@5aaf4831,
 at=org.grails.validation.ConstrainedDelegate@1bb269b3,
 category=org.grails.validation.ConstrainedDelegate@24c918dc,
 orderby=org.grails.validation.ConstrainedDelegate@26f962e,
 page=org.grails.validation.ConstrainedDelegate@2221a892,
 seoWhat=org.grails.validation.ConstrainedDelegate@2ad6a294,
 seoWhere=org.grails.validation.ConstrainedDelegate@463550ea,
 cityToShow=org.grails.validation.ConstrainedDelegate@381570e4,
 subCityToShow=org.grails.validation.ConstrainedDelegate@175f2a4c,
 f_ot=org.grails.validation.ConstrainedDelegate@802e831,
 f_vkw=org.grails.validation.ConstrainedDelegate@64dc4bdb,
 f_ra=org.grails.validation.ConstrainedDelegate@77dd95f4,
 f_ap=org.grails.validation.ConstrainedDelegate@193edc09,
 country=org.grails.validation.ConstrainedDelegate@6e2ec7f,
 countryFrom=org.grails.validation.ConstrainedDelegate@66fdeb,
 countryTo=org.grails.validation.ConstrainedDelegate@1b8fba26,
 countrycode=org.grails.validation.ConstrainedDelegate@743ee3ca,
 fuelType=org.grails.validation.ConstrainedDelegate@65ae6826,
 internationalCity=org.grails.validation.ConstrainedDelegate@521058dd,
 internationalCitycode=org.grails.validation.ConstrainedDelegate@34a89633,
 itemsPerPage=org.grails.validation.ConstrainedDelegate@378b03df,
 offset=org.grails.validation.ConstrainedDelegate@21f2b250,
 ss_le=org.grails.validation.ConstrainedDelegate@7174c003,
 ss_sd=org.grails.validation.ConstrainedDelegate@11dc910,
 ss_hc=org.grails.validation.ConstrainedDelegate@6ee7b717,
 ss_lc=org.grails.validation.ConstrainedDelegate@5ab3f8a9,
 ajaxSearch=org.grails.validation.ConstrainedDelegate@d904f24,
 isTablet=org.grails.validation.ConstrainedDelegate@62aa42cf,
 validRegionId=org.grails.validation.ConstrainedDelegate@31260e82,
 isMobile=org.grails.validation.ConstrainedDelegate@7415cebf,
 filterCount=org.grails.validation.ConstrainedDelegate@7bf34676,
 na=org.grails.validation.ConstrainedDelegate@4bffcffd},
 isMobile=false,
 f_vkw=[],
 filterCount=0,
 at=[],
 errors=grails.validation.ValidationErrors: 0 errors,
 topicCategories=[]}```

What could cause that problem?
@Erando89
Copy link
Author

Erando89 commented Jan 8, 2019

I have found out that the problem only occurs when I'm trying to convert a domain class object with defined constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant