Apache spark Spark/kryo/Joda时间:java.lang.NullPointerException

Apache spark Spark/kryo/Joda时间:java.lang.NullPointerException,apache-spark,jodatime,kryo,Apache Spark,Jodatime,Kryo,我得到: Caused by: java.lang.NullPointerException at org.joda.time.tz.CachedDateTimeZone.getInfo(CachedDateTimeZone.java:143) at org.joda.time.tz.CachedDateTimeZone.getOffset(CachedDateTimeZone.java:103) at org.joda.time.DateTimeZone.convert

我得到:

Caused by: java.lang.NullPointerException
    at org.joda.time.tz.CachedDateTimeZone.getInfo(CachedDateTimeZone.java:143)
    at org.joda.time.tz.CachedDateTimeZone.getOffset(CachedDateTimeZone.java:103)
    at org.joda.time.DateTimeZone.convertUTCToLocal(DateTimeZone.java:925)
    at org.joda.time.chrono.ZonedChronology$ZonedDateTimeField.get(ZonedChronology.java:432)
    at org.joda.time.base.AbstractDateTime.getMillisOfDay(AbstractDateTime.java:240)
我对kryo的配置如下:

val sparkConfiguration = new SparkConf().setAppName("Session Logs to Parquet Job").set("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
  sparkConfiguration.registerKryoClasses(Array(
      classOf[org.joda.time.DateTime],
      classOf[org.joda.time.Interval],
      classOf[org.joda.time.tz.DateTimeZoneBuilder],
      classOf[org.joda.time.tz.FixedDateTimeZone],
      Class.forName("org.joda.time.tz.CachedDateTimeZone$Info"),
      ClassTag(Class.forName("org.joda.time.tz.CachedDateTimeZone$Info")).wrap.runtimeClass,
      classOf[org.joda.time.tz.CachedDateTimeZone]
    )
  )
我实际使用的是:getHourOfDay(dt) 其中dt是日期时间。目标是在spark中使用kryo序列化程序。 乔达2.9.3

我错过了什么? 有什么想法吗


谢谢

反序列化的CachedDataTimeZone实例似乎已损坏。。。乔达和克鲁约不是好朋友。此外,AbstractDateTime似乎更为内部API,用户不应直接引用它,如中所述,因此,如果它操作cade,则应避免直接使用它。你在用joda 2.2吗?你能添加一段代码吗?你能告诉我你的目标是什么吗?这可能有助于解决问题。反序列化的CachedDataTimeZone实例似乎已损坏。。。乔达和克鲁约不是好朋友。此外,AbstractDateTime似乎更为内部API,用户不应直接引用它,如中所述,因此,如果它操作cade,则应避免直接使用它。你在用joda 2.2吗?你能添加一段代码吗?你能告诉我你的目标是什么吗?这可能有助于找到解决办法。