Janino Compile Exception : UDJC step

假装没事ソ 提交于 2019-12-25 11:50:36

问题


Thanks in advance for your support.

In UDJC step, the following code gives me Janino exception,

In processRow method

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

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

Exception: A method named "keySet" is not declared in any enclosing class nor any supertype, nor through a static import

In forums I could not find the turn around solution to fix this. I am using JDK 1.7 and PDI 5.1 (latest download)


回答1:


AFAIK, you can't use generics in Janino, so Janino can not determine exact class of the object returned by hashtable.get("ERROR_2001") method, so it assumes that Object is returned, which has no keySet() method defined. Try to cast the result of hashtable.get("ERROR_2001") to the value class, contained in your hashtable collection:

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


来源:https://stackoverflow.com/questions/34211217/janino-compile-exception-udjc-step

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!