-
-
Notifications
You must be signed in to change notification settings - Fork 953
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
Grails f:all fails as well as create action fails with embedded Integer field #10494
Comments
The issue is in the fields plugin. Please file an issue there: https://github.com/grails-fields-plugin/grails-fields/issues |
The reasons I added this issue here are as follows:
|
|
No, that is where you misunderstand. Create a grails project (without loading any plugin on your own). Add the two files (provided above) and do a generate-all. The views generated by grails uses the f:all on it's own. That is the default and there seems to be no way to override it through configuration. |
So it affects all grails users who uses embedded objects |
Please create the issue in the fields plugin repository and we will look into it |
That tag comes from the |
Grails f:all fails when there is an embedded object containing an Integer field
For example an embedded Address may contain Zip Code / Pin Code, which are normally captured as Integers for good validation
Task List
Steps to Reproduce
File: grails-app/domain/test/Customer.groovy
package test
class Customer {
String name
Address address
static embedded=['address']
static constraints = {
}
}
File: grails-app/domain/test/Address.groovy
package test
class Address {
String address
int pin
static constraints = {
}
}
If that somehow works then go and edit the same customer. It will fail 100% of the time
Expected Behaviour
It should allow us to create and edit customer.
Actual Behaviour
NO error is shown but the page is not displayed
In certain cases I was able to get over this step by adding a number of fields after address but then when editing it gave the error that it cannot find pinCode.
Individually I added all the fields except pinCode, in which case it gives the error that it cannot find
Stacktrace
2017-02-23 21:34:43.782 ERROR --- [nio-8080-exec-7] .a.c.c.C.[.[.[.[grailsDispatcherServlet] : Servlet.service() for servlet [grailsDispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.grails.gsp.GroovyPagesException: Error processing GroovyPageView: [views/teacher/edit.gsp:45] Error executing tag <g:form>: [views/teacher/edit.gsp:39] Error executing tag <f:field>: No such property: pinCode for class: com.taragana.Teacher] with root cause
groovy.lang.MissingPropertyException: No such property: pinCode for class: com.taragana.Teacher
at org.grails.datastore.gorm.GormInstanceApi.propertyMissing(GormInstanceApi.groovy:55)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.propertyMissing(GormEntity.groovy:57)
at org.grails.plugins.web.taglib.ValidationTagLib.parseForRejectedValue(ValidationTagLib.groovy:114)
at org.grails.plugins.web.taglib.ValidationTagLib$_closure2.doCall(ValidationTagLib.groovy:100)
at org.grails.taglib.TagOutput.captureTagOutput(TagOutput.java:78)
at org.grails.taglib.TagLibraryMetaUtils$_registerMethodMissingForTags_closure3.doCall(TagLibraryMetaUtils.groovy:58)
at grails.plugin.formfields.FormFieldsTagLib.renderNumericInput(FormFieldsTagLib.groovy:569)
at grails.plugin.formfields.FormFieldsTagLib.renderDefaultInput(FormFieldsTagLib.groovy:497)
at grails.plugin.formfields.FormFieldsTagLib.renderWidget(FormFieldsTagLib.groovy:352)
at grails.plugin.formfields.FormFieldsTagLib$_closure3.doCall(FormFieldsTagLib.groovy:156)
at org.grails.gsp.GroovyPage.invokeTagLibClosure(GroovyPage.java:417)
at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:335)
at home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp$_run_closure2$_closure27.doCall(home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp:95)
at org.grails.taglib.TagBodyClosure.executeClosure(TagBodyClosure.java:200)
at org.grails.taglib.TagBodyClosure.captureClosureOutput(TagBodyClosure.java:102)
at org.grails.taglib.TagBodyClosure.call(TagBodyClosure.java:213)
at org.grails.plugins.web.taglib.FormTagLib$_closure9.doCall(FormTagLib.groovy:447)
at org.grails.gsp.GroovyPage.invokeTagLibClosure(GroovyPage.java:417)
at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:335)
at home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp$_run_closure2.doCall(home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp:102)
at org.grails.taglib.TagBodyClosure.executeClosure(TagBodyClosure.java:200)
at org.grails.taglib.TagBodyClosure.captureClosureOutput(TagBodyClosure.java:102)
at org.grails.taglib.TagBodyClosure.call(TagBodyClosure.java:213)
at org.grails.plugins.web.taglib.SitemeshTagLib.captureTagContent(SitemeshTagLib.groovy:48)
at org.grails.plugins.web.taglib.SitemeshTagLib$_closure3.doCall(SitemeshTagLib.groovy:156)
at org.grails.gsp.GroovyPage.invokeTagLibClosure(GroovyPage.java:417)
at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:335)
at home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp.run(home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp:105)
at org.grails.gsp.GroovyPageWritable.doWriteTo(GroovyPageWritable.java:162)
at org.grails.gsp.GroovyPageWritable.writeTo(GroovyPageWritable.java:82)
at org.grails.web.servlet.view.GroovyPageView.renderTemplate(GroovyPageView.java:76)
at org.grails.web.servlet.view.AbstractGrailsView.renderWithinGrailsWebRequest(AbstractGrailsView.java:71)
at org.grails.web.servlet.view.AbstractGrailsView.renderMergedOutputModel(AbstractGrailsView.java:55)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
at org.grails.web.sitemesh.GrailsLayoutView.renderInnerView(GrailsLayoutView.java:150)
at org.grails.web.sitemesh.GrailsLayoutView.obtainContent(GrailsLayoutView.java:128)
at org.grails.web.sitemesh.GrailsLayoutView.renderTemplate(GrailsLayoutView.java:63)
at org.grails.web.servlet.view.AbstractGrailsView.renderWithinGrailsWebRequest(AbstractGrailsView.java:71)
at org.grails.web.servlet.view.AbstractGrailsView.renderMergedOutputModel(AbstractGrailsView.java:55)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1257)
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1037)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:980)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)
at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2017-02-23 21:34:48.841 ERROR --- [nio-8080-exec-4] .a.c.c.C.[.[.[.[grailsDispatcherServlet] : Servlet.service() for servlet [grailsDispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.grails.gsp.GroovyPagesException: Error processing GroovyPageView: [views/teacher/edit.gsp:45] Error executing tag <g:form>: [views/teacher/edit.gsp:39] Error executing tag <f:field>: No such property: pinCode for class: com.taragana.Teacher] with root cause
groovy.lang.MissingPropertyException: No such property: pinCode for class: com.taragana.Teacher
at org.grails.datastore.gorm.GormInstanceApi.propertyMissing(GormInstanceApi.groovy:55)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.propertyMissing(GormEntity.groovy:57)
at org.grails.plugins.web.taglib.ValidationTagLib.parseForRejectedValue(ValidationTagLib.groovy:114)
at org.grails.plugins.web.taglib.ValidationTagLib$_closure2.doCall(ValidationTagLib.groovy:100)
at org.grails.taglib.TagOutput.captureTagOutput(TagOutput.java:78)
at org.grails.taglib.TagLibraryMetaUtils$_registerMethodMissingForTags_closure3.doCall(TagLibraryMetaUtils.groovy:58)
at grails.plugin.formfields.FormFieldsTagLib.renderNumericInput(FormFieldsTagLib.groovy:569)
at grails.plugin.formfields.FormFieldsTagLib.renderDefaultInput(FormFieldsTagLib.groovy:497)
at grails.plugin.formfields.FormFieldsTagLib.renderWidget(FormFieldsTagLib.groovy:352)
at grails.plugin.formfields.FormFieldsTagLib$_closure3.doCall(FormFieldsTagLib.groovy:156)
at org.grails.gsp.GroovyPage.invokeTagLibClosure(GroovyPage.java:417)
at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:335)
at home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp$_run_closure2$_closure27.doCall(home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp:95)
at org.grails.taglib.TagBodyClosure.executeClosure(TagBodyClosure.java:200)
at org.grails.taglib.TagBodyClosure.captureClosureOutput(TagBodyClosure.java:102)
at org.grails.taglib.TagBodyClosure.call(TagBodyClosure.java:213)
at org.grails.plugins.web.taglib.FormTagLib$_closure9.doCall(FormTagLib.groovy:447)
at org.grails.gsp.GroovyPage.invokeTagLibClosure(GroovyPage.java:417)
at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:335)
at home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp$_run_closure2.doCall(home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp:102)
at org.grails.taglib.TagBodyClosure.executeClosure(TagBodyClosure.java:200)
at org.grails.taglib.TagBodyClosure.captureClosureOutput(TagBodyClosure.java:102)
at org.grails.taglib.TagBodyClosure.call(TagBodyClosure.java:213)
at org.grails.plugins.web.taglib.SitemeshTagLib.captureTagContent(SitemeshTagLib.groovy:48)
at org.grails.plugins.web.taglib.SitemeshTagLib$_closure3.doCall(SitemeshTagLib.groovy:156)
at org.grails.gsp.GroovyPage.invokeTagLibClosure(GroovyPage.java:417)
at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:335)
at home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp.run(home_angsuman_work_StudentMgmt_grails_app_views_teacher_edit_gsp:105)
at org.grails.gsp.GroovyPageWritable.doWriteTo(GroovyPageWritable.java:162)
at org.grails.gsp.GroovyPageWritable.writeTo(GroovyPageWritable.java:82)
at org.grails.web.servlet.view.GroovyPageView.renderTemplate(GroovyPageView.java:76)
at org.grails.web.servlet.view.AbstractGrailsView.renderWithinGrailsWebRequest(AbstractGrailsView.java:71)
at org.grails.web.servlet.view.AbstractGrailsView.renderMergedOutputModel(AbstractGrailsView.java:55)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
at org.grails.web.sitemesh.GrailsLayoutView.renderInnerView(GrailsLayoutView.java:150)
at org.grails.web.sitemesh.GrailsLayoutView.obtainContent(GrailsLayoutView.java:128)
at org.grails.web.sitemesh.GrailsLayoutView.renderTemplate(GrailsLayoutView.java:63)
at org.grails.web.servlet.view.AbstractGrailsView.renderWithinGrailsWebRequest(AbstractGrailsView.java:71)
at org.grails.web.servlet.view.AbstractGrailsView.renderMergedOutputModel(AbstractGrailsView.java:55)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1257)
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1037)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:980)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)
at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Environment Information
| Grails Version: 3.2.4
| Groovy Version: 2.4.7
| JVM Version: 1.8.0_92
Example Application
The text was updated successfully, but these errors were encountered: