Janino 编译异常:UDJC 步骤

Janino Compile Exception : UDJC step

在此先感谢您的支持。

在UDJC步骤中,下面的代码给出了Janino异常,

在 processRow 方法中

Hashtable hastable=getConfigData() // This method return Hashtable 

Set set=hashtable.get("ERROR_2001").keySet(); ---> //hashtable.get("ERROR_2001"), This returns another hashtable

异常: 名为 "keySet" 的方法未在任何封闭 class 或任何超类型中声明,也未通过静态导入

声明

在论坛中我找不到解决此问题的解决方案。我正在使用 JDK 1.7 和 PDI 5.1(最新下载)

AFAIK,您不能在 Janino 中使用泛型,因此 Janino 无法确定 hashtable.get("ERROR_2001") 方法返回的对象的确切 class,因此它假定返回 Object ,其中没有定义 keySet() 方法。 尝试将 hashtable.get("ERROR_2001") 的结果转换为值 class,包含在您的 hashtable 集合中:

Hashtable errorEntry = (Hashtable) hashtable.get("ERROR_2001");
Set set = errorEntry.keySet();