我已经定义
var status:String = null;
var error_msg:String = null;
try{ status ="Error"; error_msg= "n/a";
}
当我将方法放在DbUtils对象中并从主类调用时,它会引发错误,即,调用
DbUtils.writeToCassandraAuditLog(spark, status, error_msg);
它抛出错误以下
2018-10-23 14:03:37 ERROR java.lang.RuntimeException: error reading Scala signature of com.snp.utils.DbUtils: error reading Scala signature of org.apache.spark.sql.package: assertion failed: unsafe symbol Unstable (child of <none>) in runtime reflection universe
at scala.reflect.internal.pickling.UnPickler.unpickle(UnPickler.scala:46)
但是当我在主类/对象中放置/定义方法时,它运行良好。
writeToCassandraAuditLog(spark, status, error_msg);
如何解决此问题?