{"record":{"id":"c1324d3659dc0297","repo":"pentaho/pentaho-kettle","slug":"e-getmessage","errorCode":null,"errorMessage":"e.getMessage()","messagePattern":"e\\.getMessage\\(\\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/httppost/HTTPPOST.java","lineNumber":521,"sourceCode":"    StringBuffer buf = new StringBuffer();\n    try {\n      for ( int i = 0; i < pairs.length; ++i ) {\n        NameValuePair pair = pairs[ i ];\n        if ( pair.getName() != null ) {\n          if ( i > 0 ) {\n            buf.append( \"&\" );\n          }\n\n          buf.append( URLEncoder.encode( pair.getName(), !StringUtil.isEmpty( charset ) ? charset : DEFAULT_ENCODING ) );\n          buf.append( \"=\" );\n          if ( pair.getValue() != null ) {\n            buf.append( URLEncoder.encode( pair.getValue(), !StringUtil.isEmpty( charset ) ? charset : DEFAULT_ENCODING ) );\n          }\n        }\n      }\n      return buf.toString();\n    } catch ( UnsupportedEncodingException e ) {\n      throw new KettleException( e.getMessage(), e.getCause() );\n    }\n  }\n\n  public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {\n    meta = (HTTPPOSTMeta) smi;\n    data = (HTTPPOSTData) sdi;\n\n    if ( super.init( smi, sdi ) ) {\n      // get authentication settings once\n      data.realProxyHost = environmentSubstitute( meta.getProxyHost() );\n      data.realProxyPort = Const.toInt( environmentSubstitute( meta.getProxyPort() ), 8080 );\n      data.realHttpLogin = environmentSubstitute( meta.getHttpLogin() );\n      data.realHttpPassword = Utils.resolvePassword( variables, meta.getHttpPassword() );\n\n      data.realSocketTimeout = Const.toInt( environmentSubstitute( meta.getSocketTimeout() ), -1 );\n      data.realConnectionTimeout = Const.toInt( environmentSubstitute( meta.getSocketTimeout() ), -1 );\n      data.realcloseIdleConnectionsTime =\n        Const.toInt( environmentSubstitute( meta.getCloseIdleConnectionsTime() ), -1 );","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/httppost/HTTPPOST.java#L503-L539","documentation":"getRequestBodyParamsAsStr encodes parameter pairs with URLEncoder.encode using a charset; if that charset is not supported by the JVM, UnsupportedEncodingException is caught and rethrown as KettleException whose message is e.getMessage() (the unsupported charset name).","triggerScenarios":"bodyParams or getRequestBodyParametersAsStringWithNullEncoding call getRequestBodyParamsAsStr; the step's configured encoding (meta.getEncoding(), via data.realEncoding/charset) is not a supported charset name (e.g. misspelled 'utf_8', 'utf-8859-1').","commonSituations":"Typo in the 'Encoding' field of the step dialog; using an encoding name not present on the JVM; passing user/env-provided encoding strings like '${ENC}' that resolve incorrectly.","solutions":["Set the step Encoding to a valid charset name such as 'UTF-8' or 'ISO-8859-1'.","Leave the encoding blank to fall back to DEFAULT_ENCODING when unsure.","Verify supported names via Charset.availableCharsets() or java.nio.charset docs.","Fix any environment variable supplying the encoding value."],"exampleFix":"// before (dialog config)\nencoding=\"utf_8\"; // invalid\n// after\nencoding=\"UTF-8\"; // valid IANA charset name","handlingStrategy":"validation","validationCode":"String enc = meta.getEncoding();\nif (enc != null && !enc.isEmpty() && !java.nio.charset.Charset.isSupported(enc))\n  throw new KettleException(\"Unsupported encoding: \" + enc);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use canonical charset names (UTF-8, ISO-8859-1)","Leave Encoding blank to use the default"],"tags":["encoding","charset","http-post","pentaho"],"backgroundTag":"invalid-config-value","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}