|Issue 530:||Improved SerializedCache compatibility with frameworks that use custom classloaders - patch provided|
|2 people starred this issue and may be notified of changes.||Back to list|
What version of the MyBatis are you using? SNAPSHOT Please describe the problem. Unit tests are best! I was having some issues integrating mybatis with playframework. Because play is using a custom classloader to do it's class reload "magic", during the cache deserialization ObjectInputStream was locating the required class using the default Launcher.AppClassLoader classloader, thus resulting in a ClassCastException when casting to the actual object: - upon serialization the play classloader was being used - expected - upon deserialization the Launcher.AppClassLoader was used, resulting in a ClassCastException The proposed solution is to extend ObjectInputStream and override resolveClass method and force the use of the Thread.currentThread().getContextClassLoader(). I have attached a patch with these changes - I hope I got it right, cause it's the first time I'm creating a patch :) Anyway, if you don't foresee any unpleasant side effects it would be great if you could include this in a future release. Thanks!
Mar 17, 2012
you are doing a great job with MyBatisPlay. Do not hesitate to ask us for help or changes if you need them. May be fixed in r4940. I will uplodad a 3.1.1 snapshot in a short, please give it a try and let me know.
Mar 17, 2012
(No comment was entered for this change.)
Mar 19, 2012
I have just tested the latest commit and it works fine. When you'll release the next version to maven repositories I'll remove MyBatis source from the module and just add a dependency to the latest stable release. Thanks!
|► Sign in to add a comment|