0

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)

Hari
  • 441
  • 6
  • 15

1 Answers1

2

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(); 
Andrei Luksha
  • 1,020
  • 1
  • 9
  • 13
  • Sorry for the late response. Yes, I have done the same way what you said and all the errors gone. – Hari Jan 04 '16 at 21:28