0

我收到以下错误:

Failed to parse: could not instantiate '<pigUDF>' with arguments
'null' while using UDFContext for json parsing.
.
.
Caused by: java.io.EOFException: No content to map to Object due to
end of input

当然,在不使用 UDFContext 的情况下解析 json 时不会出错。

方法是这样写的:

private static final String JSON_FILE= "json_file";

private void loadJSONInUDFContext() throws JsonProcessingException, FileNotFoundException, IOException {    

            UDFContext udfContext = UDFContext.getUDFContext();
            Properties properties = 
              udfContext.getUDFProperties([pigUDF.class);

            List<TopicAndIndicator> list = JSONLoader.parseJSON();              

            properties.put(JSON_FILE, list);
}

我在本地运行时没有出错,但在服务器上运行时出错。

4

0 回答 0