code: public KryoInstantiator setThreadContextClassLoader() {
      return new KryoInstantiator() {
        public Kryo newKryo() {
          Kryo k = KryoInstantiator.this.newKryo();
          k.setClassLoader(Thread.currentThread().getContextClassLoader());
          return k;
        }
      };
    }
docs: Use Thread.currentThread().getContextClassLoader() as the ClassLoader where ther newKryo is called