Greetings All,
I am having some strange, intermittent connection refused problems with the Axis2 client. I have used Axis2 1.4.1 to construct a java stub class from a SOAP server WSDL. In a jboss server, I instantiate the stub and use it to send requests to the SOAP server. This generally works fine, but occasionally (as often as once a day), the Axis2 engine will begin to throw Connection refused faults on every SOAP call. The strange thing is, in this state ngrep shows zero packets to or from the SOAP server. It seems clear that the connection refused faults are generated without ever attempting to communicate with the SOAP server. At this point, only redeploying the application will fix the issue. Even instantiating a new stub will not allow communication to resume. Does anyone have any ideas what might be happening and how it can be fixed? If nothing else, is there a way to reinitialize the Axis engine without redeploying? This is the stub initialization code. It is also called when we want to reinitialize the connection (such as when we detect a config change or when we get into this state where communication is failing) public void start() { HttpTransportProperties.Authenticator authenticator = new HttpTransportProperties.Authenticator(); authenticator.setPreemptiveAuthentication (true); authenticator.setAuthSchemes(Arrays.asList(new String[]{HttpTransportProperties.Authenticator.BASIC})); authenticator.setUsername(BasicAuthUserName); authenticator.setPassword(BasicAuthPassword); TransportOutDescription tod = new TransportOutDescription(org.apache.axis2.Constants.TRANSPORT_HTTPS); CommonsHTTPTransportSender httpSender = new CommonsHTTPTransportSender(); tod.setSender(httpSender); if(null != stub) { try { stub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTO_REL EASE_CONNECTION, Boolean.TRUE); stub._getServiceClient().getOptions().setCallTransportCleanup(true); } catch (Throwable e) { LOG.warn("error when trying to clean up old Axis stub",e); } } try { ConfigurationContext c = ConfigurationContextFactory.createEmptyConfigurationContext(); c.setProperty("WSAddressingVersion", "http://schemas.xmlsoap.org/ws/2004/08/addressing"); stub = new Address_ServiceStub(c, URL); stub._getServiceClient().getOptions().setProperty( HTTPConstants.AUTHENTICATE,authenticator); stub._getServiceClient().getOptions().setProperty(org.apache.axis2.addre ssing.AddressingConstants.WS_ADDRESSING_VERSION,org.apache.axis2.address ing.AddressingConstants.Submission.WSA_NAMESPACE); stub._getServiceClient().getOptions().setTransportOut(tod); stub._getServiceClient().getOptions().setProperty(HTTPConstants.REUSE_HT TP_CLIENT, Boolean.FALSE); stub._getServiceClient().getOptions().setProperty(HTTPConstants.CACHED_H TTP_CLIENT, Boolean.FALSE); } catch (AxisFault e) { LOG.error("start: Exception when setting up communication with xyz", e); } } This is a portion of the fault stack we are getting: 2009-01-27 22:31:37,264 [http-0.0.0.0-8080-10] ERROR [...] Exception when attempting to communicate with xyx server. org.apache.axis2.AxisFault: Connection refused at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:1 93) at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageW ithCommons(CommonsHTTPTransportSender.java:371) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Common sHTTPTransportSender.java:209) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper ation.java:401) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInA xisOperation.java:228) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163 ) at com._xyz.soap.wsdl.Address_ServiceStub.validateAddressRequest(Address_Se rviceStub.java:2511)