From 3bd9a3e3e0fd6e8d25a430be2221a3d13e43936e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 20 Oct 2011 11:09:14 +0000 Subject: [PATCH] RmiClientInterceptor detects nested SocketException as connect failure as well (SPR-8628) --- .../remoting/rmi/RmiClientInterceptorUtils.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org.springframework.context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptorUtils.java b/org.springframework.context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptorUtils.java index cf4d1ebf2d..79407ccdc9 100644 --- a/org.springframework.context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptorUtils.java +++ b/org.springframework.context/src/main/java/org/springframework/remoting/rmi/RmiClientInterceptorUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2011 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. @@ -18,6 +18,7 @@ package org.springframework.remoting.rmi; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.net.SocketException; import java.rmi.ConnectException; import java.rmi.ConnectIOException; import java.rmi.NoSuchObjectException; @@ -211,8 +212,8 @@ public abstract class RmiClientInterceptorUtils { public static boolean isConnectFailure(RemoteException ex) { return (ex instanceof ConnectException || ex instanceof ConnectIOException || ex instanceof UnknownHostException || ex instanceof NoSuchObjectException || - ex instanceof StubNotFoundException || isCorbaConnectFailure(ex.getCause()) || - ORACLE_CONNECTION_EXCEPTION.equals(ex.getClass().getName())); + ex instanceof StubNotFoundException || ex.getCause() instanceof SocketException || + isCorbaConnectFailure(ex.getCause()) || ORACLE_CONNECTION_EXCEPTION.equals(ex.getClass().getName())); } /**