SWS-482 - java.lang.IllegalStateException: Connection factory has been shutdown

This commit is contained in:
Arjen Poutsma
2009-05-20 11:35:53 +00:00
parent ec15995693
commit a231bb82bd

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@ import java.util.Properties;
import org.apache.commons.httpclient.Credentials;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpConnectionManager;
import org.apache.commons.httpclient.HttpURL;
import org.apache.commons.httpclient.HttpsURL;
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
@@ -34,7 +33,6 @@ import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.PostMethod;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
import org.springframework.ws.transport.WebServiceConnection;
@@ -53,8 +51,7 @@ import org.springframework.ws.transport.WebServiceConnection;
* @see #setCredentials(Credentials)
* @since 1.0.0
*/
public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSender
implements InitializingBean, DisposableBean {
public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSender implements InitializingBean {
private static final int DEFAULT_CONNECTION_TIMEOUT_MILLISECONDS = (60 * 1000);
@@ -217,13 +214,6 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
}
}
public void destroy() throws Exception {
HttpConnectionManager connectionManager = getHttpClient().getHttpConnectionManager();
if (connectionManager instanceof MultiThreadedHttpConnectionManager) {
((MultiThreadedHttpConnectionManager) connectionManager).shutdown();
}
}
public WebServiceConnection createConnection(URI uri) throws IOException {
PostMethod postMethod = new PostMethod(uri.toString());
if (isAcceptGzipEncoding()) {