benlucchesi / grails-cookie-session

cookie sessions for grails applications
28 stars 32 forks source link

no valid serializer configured. defaulting to java #34

Closed danielschonfeld closed 10 years ago

danielschonfeld commented 10 years ago
 class KryoForNewGrailsSerializer implements SessionSerializer, InitializingBean{

final static Logger log = Logger.getLogger(KryoForNewGrailsSerializer.class.getName());

@Override
void afterPropertiesSet() throws Exception {

}

@Override
byte[] serialize(SerializableSession session) {
    return new byte[0]
}

@Override
SerializableSession deserialize(byte[] serializedSession) {
    return null
}
}

Seems like the instanceOf if statement inside CookieSessionRepository is returning false, not sure why. Yes I have added it as a bean to resources.groovy

benlucchesi commented 10 years ago

ok, I'll check this out. FYI - I've got a couple of updates that I need to roll out. I'll hopefully have them ready to go in the next week or two. If there's a fix that needs to be implemented, I'll add it to this update.

Ben Lucchesi | Chief Software Architect Granicus, Inc.work: 415.357.3618 x1300 [X]http://www.granicus.com/ Follow Us! Bloghttp://blog.granicus.com/ | Twitterhttp://twitter.com/granicus | Facebookhttp://www.facebook.com/pages/Granicus/134633056573520


From: Daniel Schonfeld [notifications@github.com] Sent: Thursday, February 27, 2014 1:40 PM To: benlucchesi/grails-cookie-session-v2 Subject: [grails-cookie-session-v2] no valid serializer configured. defaulting to java (#34)

class KryoForNewGrailsSerializer implements SessionSerializer, InitializingBean{

final static Logger log = Logger.getLogger(KryoForNewGrailsSerializer.class.getName());

@Override void afterPropertiesSet() throws Exception {

}

@Override byte[] serialize(SerializableSession session) { return new byte[0] }

@Override SerializableSession deserialize(byte[] serializedSession) { return null }

}

Seems like the instanceOf if statement inside CookieSessionRepository is returning false, not sure why. Yes I have added it as a bean to resources.groovy

— Reply to this email directly or view it on GitHubhttps://github.com/benlucchesi/grails-cookie-session-v2/issues/34.

benlucchesi commented 10 years ago

Hi Daniel,

Can you give me a description of what you're trying to accomplish? Are you trying to implement a custom serializer for an object using the Kryo serializer?

-ben

danielschonfeld commented 10 years ago

Hi Ben,

I was trying to override your Kryo serializer because it had the wrong GrailsUser package. But the problem I ran into seemed to have affected any kind of serializer I would have wanted to use. I think that for a reason that I cannot explain the "instanceOf SessionSerializer" if statement is returning false when writing your own custom serializer.

Am I wrong in that? Thanks!

benlucchesi commented 10 years ago

Hi Daniel,

So piecing together the scenario you're facing, you're probably using the new spring-security-core 2.x plugin in conjunction with cookie sessions. Besides rewriting the kryo serializer for cookie sessions, you would have also needed to update some of the spring security compatibility code in the cookie-session plugin.

The good news is that I've released an update (2.0.14) to the cookie-session plugin that has built in support for the new spring security core plugin. so if you update to this version of the plugin, everything should just work.

If you find yourself in need to writing additional custom serializers for kryo, let me know and I'll help you work through that.

Ben Lucchesi | Chief Software Architect Granicus, Inc.work: 415.357.3618 x1300 [X]http://www.granicus.com/ Follow Us! Bloghttp://blog.granicus.com/ | Twitterhttp://twitter.com/granicus | Facebookhttp://www.facebook.com/pages/Granicus/134633056573520


From: Daniel Schonfeld [notifications@github.com] Sent: Tuesday, March 04, 2014 11:46 AM To: benlucchesi/grails-cookie-session-v2 Cc: Benjamin Lucchesi Subject: Re: [grails-cookie-session-v2] no valid serializer configured. defaulting to java (#34)

Hi Ben,

I was trying to override your Kryo serializer because it had the wrong GrailsUser package. But the problem I ran into seemed to have affected any kind of serializer I would have wanted to use. I think that for a reason that I cannot explain the "instanceOf SessionSerializer" if statement is returning false when writing your own custom serializer.

Am I wrong in that? Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/benlucchesi/grails-cookie-session-v2/issues/34#issuecomment-36665564.

benlucchesi commented 10 years ago

NOTE: