ClassCastException for same class on slim3 for Google App Engine

Bug: A class cast exception like the following is thrown – class x.y.z.MyClass cannot be cast to class x.y.z.MyClass

Reason: The class loaders for both these class instances are different. One of the classloader is the usual one used by AppEngine JVM, while other one is used by the hot reloader.

Solution: Remove the Filter and Filter-Mapping for HotReloadingFilter from web.xml.

Sreekumar Kj
Sreekumar (KJ) has been a hobby programmer from school days. Codemarvels is his personal blog from the year 2010, where he writes about technology, philosophy, society and a bit about physics. He now runs a conversational AI company - DheeYantra - focusing his efforts to help businesses improve operational efficiency using digital employees powered by AI.