Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Janino Compile Exception : UDJC

  1. #1

    Default Janino Compile Exception : UDJC

    Hello,

    Thanks in advance for your support.

    In UDJC, 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)
    Last edited by ghkgupta; 12-10-2015 at 01:22 PM.

  2. #2

    Default

    I resolved the problem but could not get find proper explanation,

    public List loadStatusItems(String p_StatusItems)
    {
    StringTokenizer strTokenizer=null;
    List statusCheckItems=new ArrayList();
    try
    {
    strTokenizer=new StringTokenizer(p_StatusItems, ",");
    while (strTokenizer.hasMoreTokens())
    {
    statusCheckItems.add(strTokenizer.hasToken()); --> This line gives the exception



    String p_TempStr=strTokenizer.hasToken(); --> This line does not give any exception.
    statusCheckItems.add(p_TempStr);
    }
    }
    catch(Exception exception)
    {
    exception.printStackTrace();
    }
    finally
    {
    strTokenizer=null;
    }
    }

    Is it something that Janino does not understand the former line than later one

  3. #3
    Join Date
    Aug 2011
    Posts
    360

    Default

    I think the method is nextToken(), not hasToken().

    Generally in the UDJC the janino compiler dont understand every stuffs of java, mainly only java5.
    So it dont understand Generic types (ArrayMap<String> for exemple) so some time you have to explicitly
    type cast the returned value of some functions

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.