I am using JIRA Soap Service API to create / modify issues. Facing connection time out issue randomly with different methods as explained below.
private JiraSoapServiceService jiraSoapServiceLocator;
public RemoteIssue updateIssueField (String issue_key, String fieldName, String[] values) throws RemoteException {
try {
String fid = getFieldIdInEditOperation(issue_key, fieldName);
if (fid == null) {
logger.error("Field id not found for the field " + fieldName);
returnnull;
} else {
RemoteFieldValue rfv[] = {new RemoteFieldValue (fid, values)};
RemoteIssue issue = jiraSoapService.updateIssue(token, issue_key, rfv);
return issue;
}
} catch (Exception ex) {
logger.error(SOAPUtil.getStackTrace(ex));
thrownew RemoteException (ex.getMessage());
} finally {
timing.printTiming(logger);
}
}
Sometimes jiraSoapService.updateIssue method failing with connection timeout issues with the following stack trace.
2011-07-01 01:58:05,758 INFO [main] (Timing.java:15) - Running : getFieldIdInEditOperation
2011-07-01 01:58:07,451 INFO [main] (SOAPSession.java:713) - Fix Version/s field name found.
2011-07-01 01:58:07,451 INFO [main] (Timing.java:21) - ________________________________________________________________
2011-07-01 01:58:07,451 INFO [main] (Timing.java:23) - getFieldIdInEditOperation took 1,693 ms to run
2011-07-01 01:58:07,452 INFO [main] (Timing.java:21) - ________________________________________________________________
2011-07-01 01:58:07,452 INFO [main] (Timing.java:23) - getFieldIdInEditOperation took 1,694 ms to run
2011-07-01 01:58:28,486 ERROR [main] (SOAPSession.java:454) - ; nested exception is: java.net.ConnectException: Connection timed out: connect
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.ConnectException: Connection timed out: connect
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.atlassian.jira.rpc.soap.client.JirasoapserviceV2SoapBindingStub.updateIssue(JirasoapserviceV2SoapBindingStub.java:5415)
at com.vs.jiracli.SOAPSession.updateIssueField(SOAPSession.java:450)
at com.vs.jiracli.SOAPSession.updateIssueField(SOAPSession.java:419)
at com.vs.jiracli.SOAPSession.updateAbacusIssue(SOAPSession.java:1066)
at com.vs.jiracli.SOAPSession.modifyAbacusIssue(SOAPSession.java:1244)
at com.vs.jiracli.Abacus.createJIRARecords(Abacus.java:157)
at com.vs.jiracli.Abacus.main(Abacus.java:71)
{http://xml.apache.org/axis/}hostname:vs
java.net.ConnectException: Connection timed out: connect
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.atlassian.jira.rpc.soap.client.JirasoapserviceV2SoapBindingStub.updateIssue(JirasoapserviceV2SoapBindingStub.java:5415)
at com.vs.jiracli.SOAPSession.updateIssueField(SOAPSession.java:450)
at com.vs.jiracli.SOAPSession.updateIssueField(SOAPSession.java:419)
at com.vs.jiracli.SOAPSession.updateAbacusIssue(SOAPSession.java:1066)
at com.vs.jiracli.SOAPSession.modifyAbacusIssue(SOAPSession.java:1244)
at com.vs.jiracli.Abacus.createJIRARecords(Abacus.java:157)
at com.vs.jiracli.Abacus.main(Abacus.java:71)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
... 16 more
2011-07-01 01:58:28,486 INFO [main] (Timing.java:21) - ________________________________________________________________
2011-07-01 01:58:28,487 INFO [main] (Timing.java:23) - updateIssueField took 22,728 ms to run
After failing with this exception, some operations work fine perfectly but again fails with some other method with the same exception. How to fix this issue?
Community moderators have prevented the ability to post new answers.
Thank you for your answer. Even I am thinking in the same lines to do some number of retries before giving up. Thought there might be some solution to this interms of increasing the timeout or taking care of something from the JIRA side.
How about (maybe!) some heavy usage on the server?
TCP problems can be detected at the OS level, for instance:
netstat -ap | grep java | grep <service> | wc -l
(see how many connections are open at a certain point)
Anyway, you should check the configuration and the usage patterns first, since this error may came from a number of reasons.
Check the Tomcat documentation, it's here: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
You should take a closer look at acceptCount, keepAlive, ...
You can still implement a retry;
for(int i = 0; i < MAX_ATTEMPTS; i++) {
try { return callMyWebservice(); } catch(....) {}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.