-
Notifications
You must be signed in to change notification settings - Fork 96
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 with Grails Spring Security UI Plugin when creating new user - Error Processing GroovyPageView #56
Comments
By major coincidence, I ran into the exact same issue with the exact same versions of grails and the two plugins today. @mickdavis: I feel your pain. |
I think I found the issue. Spring-security-ui does not like it when the "Person" and "Role" domain objects (see http://grails-plugins.github.io/grails-spring-security-core/v2/guide/domainClasses.html#personClass) return null in their "toString" methods. So my solution was to change
to
(this is for the |
Btw. I think the issue is still a bug in spring-security-ui, I will probably create a pull request soon. |
fixes grails#56, grails#51 Otherwise the bean will be cast to string in `labelCode`, which will throw an assertion error if the bean returns null in its "toString" method. Also, I cannot see why somebody would want to use the `toString` of e.g. a user object to look up the localization of the label of that field. That just does not make sense. user.username.label resp. role.authority.label is way more intuitive..
@marvinthepa - your patch - can't get it working. Can't get an override - I'll need to rebuild the entire plugin and use that one from a local repo vs just being able to override it somehow? Was also trying to get my subclassed usercontroller to work in a namespace, but if the namespace is different from the parent class, that seems like it won't work either... (or would it?) (the toString() stuff didn't work for me, unfortunately) Thanks for your potential patch :) |
@mgkimsal: I don't know if you can override taglibs. Building the plugin yourself from source will definitely work. If fixing your |
@mickdavis @marvinthepa
using Here's a link to a video demonstrating it working: and here's the test app I created: Are you able to provide a test app which reproduces the issue? Thanks! |
to reproduce this with your example, you have to add a diff --git a/grails-app/domain/com/testapp/User.groovy b/grails-app/domain/com/testapp/User.groovy
index aacd5d0..235d48c 100644
--- a/grails-app/domain/com/testapp/User.groovy
+++ b/grails-app/domain/com/testapp/User.groovy
@@ -52,4 +52,9 @@ class User implements Serializable {
static mapping = {
password column: '`password`'
}
+
+ @Override
+ public String toString() {
+ return username
+ }
} |
…new user - Error Processing GroovyPageView Modified `form` tag so that • `pageScope.s2uiBeanType` consistently set to the bean name
…new user - Error Processing GroovyPageView Modified `form` tag so that • `pageScope.s2uiBeanType` consistently set to the bean name
Thanks @ddelponte for fixing this |
I'm getting the following error using the Spring Security UI Plugin when I click on the link to create a new user:
"Error processing GroovyPageView: Error executing tag <s2ui:form>: Error executing tag <s2ui:tabs>: Error executing tag <s2ui:tab>: Error executing tag <s2ui:textFieldRow>: assert beanType | null"
I'm running Grails 2.5.5 with SpringSecurityCore 2.0.0 and SpringSecurityUI 1.0-RC3. I have not customized anything about the plugins.
Everything was working fine for several days. I'm able to create Roles, I can search for and edit Users. Everything except the ability to create a new User. I've spent over 8 hours trying to debug this.
Here's the trace:
`Line | Method
->> 528 | doFilter in /home/mdavis/development/grails/maintenanceManager/target/work/plugins/spring-security-ui-1.0-RC3/grails-app/views/user/create.gsp
Caused by GrailsTagException: Error executing tag s2ui:form: Error executing tag s2ui:tabs: Error executing tag s2ui:tab: Error executing tag s2ui:textFieldRow: assert beanType
|
null
->> 35 | doCall in /home/mdavis/development/grails/maintenanceManager/target/work/plugins/spring-security-ui-1.0-RC3/grails-app/views/user/create.gsp
Caused by GrailsTagException: Error executing tag s2ui:tabs: Error executing tag s2ui:tab: Error executing tag s2ui:textFieldRow: assert beanType
|
null
->> 31 | doCall in /home/mdavis/development/grails/maintenanceManager/target/work/plugins/spring-security-ui-1.0-RC3/grails-app/views/user/create.gsp
Caused by GrailsTagException: Error executing tag s2ui:tab: Error executing tag s2ui:textFieldRow: assert beanType
|
null
->> 21 | doCall in /home/mdavis/development/grails/maintenanceManager/target/work/plugins/spring-security-ui-1.0-RC3/grails-app/views/user/create.gsp
Caused by GrailsTagException: Error executing tag s2ui:textFieldRow: assert beanType
|
null
->> 13 | doCall in /home/mdavis/development/grails/maintenanceManager/target/work/plugins/spring-security-ui-1.0-RC3/grails-app/views/user/create.gsp
Caused by PowerAssertionError: assert beanType
|
null
->> 817 | labelCode in SecurityUiTagLib.groovy`
Any help would be greatly appreciated. Sorry in advance if this is hard to read, I've never posted anything here before.
Thanks in advance.
Mick
The text was updated successfully, but these errors were encountered: