Uploaded image for project: 'Pentaho Data Integration - Kettle'
  1. Pentaho Data Integration - Kettle
  2. PDI-2611

User Defined Java Expression throws exception when method is used that throws an exception by itself

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Unknown
    • Resolution: Fixed
    • Affects Version/s: 3.2.0 GA
    • Fix Version/s: 3.2.1, 4.0.0 GA
    • Component/s: Step
    • Labels:
      None
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      Example: When the Java expression contains
      org.pentaho.di.core.Const.getIPAddress()

      This method is defined with "throws Exception" and gets this exception when compiling with Janino:

      User Defined Java Expression.0 - Unexpected error in : org.pentaho.di.core.exception.KettleValueException:
      org.codehaus.janino.CompileException: Line 1, Column 39: Thrown exception of type "java.lang.Exception" is neither caught by a "try...catch" block nor declared in the "throws" clause of the declaring function
      Line 1, Column 39: Thrown exception of type "java.lang.Exception" is neither caught by a "try...catch" block nor declared in the "throws" clause of the declaring function

      ERROR 12-08 15:32:29,221 - User Defined Java Expression.0 - org.pentaho.di.core.exception.KettleValueException:
      org.codehaus.janino.CompileException: Line 1, Column 39: Thrown exception of type "java.lang.Exception" is neither caught by a "try...catch" block nor declared in the "throws" clause of the declaring function
      Line 1, Column 39: Thrown exception of type "java.lang.Exception" is neither caught by a "try...catch" block nor declared in the "throws" clause of the declaring function

      at org.pentaho.di.trans.steps.janino.Janino.calcFields(Janino.java:234)
      at org.pentaho.di.trans.steps.janino.Janino.processRow(Janino.java:91)
      at org.pentaho.di.trans.steps.janino.Janino.run(Janino.java:265)
      Caused by: org.codehaus.janino.CompileException: Line 1, Column 39: Thrown exception of type "java.lang.Exception" is neither caught by a "try...catch" block nor declared in the "throws" clause of the declaring function
      at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java)

        Attachments

          Activity

            People

            • Assignee:
              gdavid Golda Thomas
              Reporter:
              jbleuel Jens Bleuel
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: