jenkins java插件字段给出错误消息414原因:URI太长

时间:2017-06-21 06:00:30

标签: java jenkins plugins

当我的插件中的字段填充大约5000个字符时,它会出错:

Bad Message 414
reason: URI Too Long

当我减少一点时,它会给出:

Bad Message 431
reason: Request Header Fields Too Large

config.jelly:

<f:entry field="field" title="Example">
   <f:textarea value="${it.getField()}"/>
</f:entry>

的java:

private String field;
...
public FormValidation doCheckField(@QueryParameter String value)
            throws IOException, ServletException {
    if (value.length() == 0) {
        return FormValidation.error("Please set an input");
    } else {
        return FormValidation.ok();
    }
}

1 个答案:

答案 0 :(得分:4)

通过添加到Jenkins config

来修复它
  • /etc/sysconfig/jenkins用于默认SLES安装
  • Windows中的
  • C:\Program Files (x86)\Jenkins\jenkins.xml
JENKINS_ARGS="--requestHeaderSize=32768"