spring-security : Adding UserRole.create(..) in webflow causes NotSerializableException

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

spring-security : Adding UserRole.create(..) in webflow causes NotSerializableException

micke
Thought I'd mention this here just in case it is something which should be looked at. But I suspect we just wait till we get a newer version of hibernate where this appears to be fixed.

Curious about what in the normal looking UserRole.create code which introduces this?

static UserRole create(User user, Role role, boolean flush = false) {
        new UserRole(user: user, role: role).save(flush: flush, insert: true)
}

There is a workaround here: http://jira.grails.org/browse/GRAILS-6648

Stack trace:

Caused by: java.io.NotSerializableException: org.hibernate.util.MarkerObject
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
        at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
        at java.util.HashMap.writeObject(HashMap.java:1001)
Reply | Threaded
Open this post in threaded view
|

Re: spring-security : Adding UserRole.create(..) in webflow causes NotSerializableException

Kelly
I think it's the Apache HashCodeBuilder used in the SecUserSecRole domain not being Serializable.
Reply | Threaded
Open this post in threaded view
|

Re: spring-security : Adding UserRole.create(..) in webflow causes NotSerializableException

Kelly
Actually just tested this and it doesn't appear this is why. Removed use of Apache library and still get error.
Reply | Threaded
Open this post in threaded view
|

Re: spring-security : Adding UserRole.create(..) in webflow causes NotSerializableException

Burt Beckwith
Administrator
Right - it's a method-scope variable, not a class field, so it wouldn't be serialized.

Try this :) http://www.google.com/search?q=NotSerializableException+MarkerObject+Grails

Burt

> Actually just tested this and it doesn't appear this is why. Removed use of
> Apache library and still get error.
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://grails-plugins.847840.n3.nabble.com/spring-security-Adding-UserRole-create-in-webflow-causes-NotSerializableException-tp2738628p3303353.html
> To start a new topic under Grails Plugins, email [hidden email]
> To unsubscribe from Grails Plugins, visit