提交 13db805d 编写于 作者: J Jesse Glick 提交者: Oleg Nenashev

[JENKINS-26677] Avoid using ServletException from SlaveComputer since it can...

[JENKINS-26677] Avoid using ServletException from SlaveComputer since it can break calls to SlaveComputer.getChannelToMaster. (#3778)

java.lang.NoClassDefFoundError: javax/servlet/ServletException
	at hudson.util.ProcessTree.get(ProcessTree.java:399)
上级 bd06d4f1
......@@ -76,7 +76,6 @@ import org.kohsuke.stapler.interceptor.RequirePOST;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import javax.annotation.OverridingMethodsMustInvokeSuper;
import javax.servlet.ServletException;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
......@@ -716,7 +715,7 @@ public class SlaveComputer extends Computer {
}
@RequirePOST
public HttpResponse doDoDisconnect(@QueryParameter String offlineMessage) throws IOException, ServletException {
public HttpResponse doDoDisconnect(@QueryParameter String offlineMessage) {
if (channel!=null) {
//does nothing in case computer is already disconnected
checkPermission(DISCONNECT);
......@@ -741,11 +740,18 @@ public class SlaveComputer extends Computer {
}
@RequirePOST
public void doLaunchSlaveAgent(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
@Override
public void doLaunchSlaveAgent(StaplerRequest req, StaplerResponse rsp) throws IOException {
checkPermission(CONNECT);
if(channel!=null) {
req.getView(this,"already-launched.jelly").forward(req, rsp);
try {
req.getView(this, "already-launched.jelly").forward(req, rsp);
} catch (IOException x) {
throw x;
} catch (/*Servlet*/Exception x) {
throw new IOException(x);
}
return;
}
......@@ -778,7 +784,7 @@ public class SlaveComputer extends Computer {
}
@WebMethod(name="slave-agent.jnlp")
public HttpResponse doSlaveAgentJnlp(StaplerRequest req, StaplerResponse res) throws IOException, ServletException {
public HttpResponse doSlaveAgentJnlp(StaplerRequest req, StaplerResponse res) {
return new EncryptedSlaveAgentJnlpFile(this, "slave-agent.jnlp.jelly", getName(), CONNECT);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册