Project

General

Profile

« Previous | Next » 

Revision 9206

Added by Jing Tao over 9 years ago

Don't use ssClient as a class field. Now it is a local variable. This fixed an issue that two statements using the client caused the exception - java.net.SocketTimeoutException: Read timed out.

View differences:

src/edu/ucsb/nceas/metacat/replication/ReplicationService.java
135 135
	private static final int TIMEINTERVALLIMIT = 7200000;
136 136
	public static final String REPLICATIONUSER = "replication";
137 137
	
138
	private static RestClient sslClient = null;
138
	//private static RestClient sslClient = null;
139 139
	private static int CLIENTTIMEOUT = 30000;
140 140

  
141 141
	public static final String REPLICATION_LOG_FILE_NAME = "metacatreplication.log";
......
964 964
				String datafilePath = PropertyService
965 965
						.getProperty("application.datafilepath");
966 966

  
967
				InputStream inputStream = getURLStream(url);
968 967
				
968
				
969 969
				//register data file into xml_documents table and write data file
970 970
				//into file system
971
				InputStream inputStream = null;
971 972
				try {
973
				    inputStream = getURLStream(url);
972 974
					DocumentImpl.writeDataFileInReplication(inputStream,
973 975
							datafilePath, docName, docType, docid, null, docHomeServer,
974 976
							server, DocumentImpl.DOCUMENTTABLE, false, createdDate,
......
2358 2360
	 * @return
2359 2361
	 */
2360 2362
	private static RestClient getSSLClient() {
2361
		
2363
	    RestClient sslClient = null;
2362 2364
	    if (sslClient == null) {
2363 2365
		
2364 2366
	        // set up this server's client identity

Also available in: Unified diff