Hi Arun,

It can be hard to use kryo with required registration because of issues
like this -- there isn't a good way to register all the classes that you
need transitively.  In this case, it looks like one of your classes has a
reference to a ClassTag, which in turn has a reference to some anonymous
inner class.  I'd suggest

(a) figuring out whether you really want to be serializing this thing --
its possible you're serializing an RDD which keeps a ClassTag, but normally
you wouldn't want to serialize your RDDs
(b) you might want to bring this up w/ chill -- spark offloads most of the
kryo setup for all the scala internals to chill, I'm surprised they don't
handle this already.  Looks like they still handle ClassManifests which are
from pre-scala 2.10:
https://github.com/twitter/chill/blob/master/chill-scala/src/main/scala/com/twitter/chill/ScalaKryoInstantiator.scala#L189

(c) you can always register these classes yourself, despite the crazy
names, though you'll just need to knock these out one-by-one:

scala> classOf[scala.reflect.ClassTag$$anon$1]

res0: Class[scala.reflect.ClassTag[T]{def unapply(x$1:
scala.runtime.BoxedUnit): Option[_]; def arrayClass(x$1: Class[_]):
Class[_]}] = class scala.reflect.ClassTag$$anon$1

On Mon, Apr 13, 2015 at 6:09 PM, Arun Lists <lists.a...@gmail.com> wrote:

> Hi,
>
> I am trying to register classes with KryoSerializer. This has worked with
> other programs. Usually the error messages are helpful in indicating which
> classes need to be registered. But with my current program, I get the
> following cryptic error message:
>
> *Caused by: java.lang.IllegalArgumentException: Class is not registered:
> scala.reflect.ClassTag$$anon$1*
>
> *Note: To register this class use:
> kryo.register(scala.reflect.ClassTag$$anon$1.class);*
>
> How do I find out which class needs to be registered? I looked at my
> program and registered all classes used in RDDs. But clearly more classes
> remain to be registered if I can figure out which classes.
>
> Thanks for your help!
>
> arun
>
>
>

Reply via email to