jenkins插件连接被拒绝

时间:2017-05-02 14:39:16

标签: java tomcat jenkins plugins connection

我有以下代码段,它是下面列出的Jenkins插件的一部分。问题是,在运行它时,我正在“连接被拒绝”。我在Ubuntu 16.0.4上使用Tomcat Web服务器。它托管在vultr。

错误消息(来自控制台)列在下面 - 连接被拒绝,因此无法进行其他操作

我也尝试过实际的IP地址和“localhost”

Started by user admin
[EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/workspace/testagain
Building WAR file for Project...
Opening WaveMaker project: Project
Sending WaveMaker a message: {"params":["Project"],"method":"openProject","id":5}
FATAL: Connection to http://127.0.0.1:8094 refused
java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579

调用的代码如下:


private boolean sendWaveMakerRequest(String serviceUrl, DefaultHttpClient client, String json, String expectedResponse, BuildListener listener) throws UnsupportedEncodingException, IOException, ClientProtocolException { HttpPost postRequest = new HttpPost(serviceUrl);

listener.getLogger().println("Sending WaveMaker a message: " + json); HttpResponse response = sendRequest(client, json, postRequest); if (!checkWaveMakerStatus(listener, response)) { return false; } if (!checkWaveMakerReason(listener, response)) { return false; } return checkJsonResponse(expectedResponse, listener, response); }

问题:我该怎么做才能解决问题? TIA

1 个答案:

答案 0 :(得分:0)

您可以通过转到Manage Jenkins>配置Jenkins将使用的代理服务器。管理插件>高级。这比设置JVM属性更受欢迎。

https://wiki.jenkins.io/display/JENKINS/JenkinsBehindProxy