AWS EMR上Spark Cluster模式下的ObjectMapper中的NullPointerException

时间:2018-04-17 12:44:11

标签: java apache-spark jackson yarn elastic-map-reduce

我在此行中遇到n = len(A) res = [A[i]*A[j] for i in range(n) for j in range(i, n)] 异常(在aws emr上以群集模式(yarn)运行spark)但在客户端模式下运行正常(master作为本地)

nullpointer

这是执行者的堆栈跟踪:

Map<String, Object> json = (Map<String, Object>) mapper.readValue(line, Map.class);

我使用以下依赖项:

18/04/17 12:33:16 ERROR executor.Executor: Exception in task 0.2 in stage 0.0 (TID 4)
java.lang.NullPointerException
    at com.fasterxml.jackson.databind.util.LRUMap.get(LRUMap.java:47)
    at com.fasterxml.jackson.databind.type.TypeFactory._fromClass(TypeFactory.java:707)
    at com.fasterxml.jackson.databind.type.TypeFactory._constructType(TypeFactory.java:387)
    at com.fasterxml.jackson.databind.type.TypeFactory.constructType(TypeFactory.java:354)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2161)

1 个答案:

答案 0 :(得分:0)

@Ernest Kiwele找到了这个问题。这是因为我是进口的 com.fasterxml.jackson.databind.ObjectMapper代替com.cloudera.com.fasterxml.jackson.databind.ObjectMapper