TOMEE-1632 dont hide IOException in Client

Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/94b4a96f
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/94b4a96f
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/94b4a96f

Branch: refs/heads/tomee-7.0.0-M1
Commit: 94b4a96f4dca812e6e1cc8186cc06f6ad15725db
Parents: 96bcc48
Author: Romain Manni-Bucau <rmann...@gmail.com>
Authored: Sun Sep 27 08:19:21 2015 -0700
Committer: Romain Manni-Bucau <rmann...@gmail.com>
Committed: Sun Sep 27 08:19:21 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/openejb/client/Client.java      | 8 ++++----
 .../test/java/org/apache/openejb/server/ejbd/ZEjbdTest.java  | 3 +--
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/94b4a96f/server/openejb-client/src/main/java/org/apache/openejb/client/Client.java
----------------------------------------------------------------------
diff --git 
a/server/openejb-client/src/main/java/org/apache/openejb/client/Client.java 
b/server/openejb-client/src/main/java/org/apache/openejb/client/Client.java
index 2834f2e..837a2ea 100644
--- a/server/openejb-client/src/main/java/org/apache/openejb/client/Client.java
+++ b/server/openejb-client/src/main/java/org/apache/openejb/client/Client.java
@@ -50,17 +50,15 @@ import static 
org.apache.openejb.client.Exceptions.newIOException;
 
 public class Client {
 
-    public static final String OPENEJB_CLIENT_RETRY_CONDITION_MAX = 
"openejb.client.retry.condition.max";
     private static final String OPENEJB_CLIENT_COMPATIBILITY_VERSION = 
"openejb.client.protocol.version";
 
     private static final Logger logger = Logger.getLogger("OpenEJB.client");
     private boolean FINEST = logger.isLoggable(Level.FINEST);
     private boolean FINER = logger.isLoggable(Level.FINER);
 
-    public static final ThreadLocal<Set<URI>> failed = new 
ThreadLocal<Set<URI>>();
+    public static final ThreadLocal<Set<URI>> failed = new ThreadLocal<>();
     private static final ProtocolMetaData PROTOCOL_META_DATA = new 
ProtocolMetaData();
 
-    private static final int maxConditionRetry = 
Integer.parseInt(System.getProperty(OPENEJB_CLIENT_RETRY_CONDITION_MAX, "20"));
     private static Client client = new Client();
     private static final ProtocolMetaData COMPATIBLE_META_DATA;
 
@@ -69,7 +67,7 @@ public class Client {
         COMPATIBLE_META_DATA = (null != version ? new 
ProtocolMetaData(version) : null);
     }
 
-    private List<Class<? extends Throwable>> retryConditions = new 
CopyOnWriteArrayList<Class<? extends Throwable>>();
+    private List<Class<? extends Throwable>> retryConditions = new 
CopyOnWriteArrayList<>();
     private boolean retry = false;
 
     private final Observers observers = new Observers();
@@ -389,6 +387,8 @@ public class Client {
                     }
                     throw new RemoteFailoverException("Cannot complete 
request.  Retry attempted on " + failed.size() + " servers", e);
                 }
+            } else {
+                throw new RemoteException("Cannot read the response from the 
server (" + protocolRequest.getSpec() + ") : " + e.getMessage(), e);
             }
 
         } catch (final Throwable error) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/94b4a96f/server/openejb-ejbd/src/test/java/org/apache/openejb/server/ejbd/ZEjbdTest.java
----------------------------------------------------------------------
diff --git 
a/server/openejb-ejbd/src/test/java/org/apache/openejb/server/ejbd/ZEjbdTest.java
 
b/server/openejb-ejbd/src/test/java/org/apache/openejb/server/ejbd/ZEjbdTest.java
index 5852661..8c0fb7b 100644
--- 
a/server/openejb-ejbd/src/test/java/org/apache/openejb/server/ejbd/ZEjbdTest.java
+++ 
b/server/openejb-ejbd/src/test/java/org/apache/openejb/server/ejbd/ZEjbdTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.openejb.server.ejbd;
 
-import org.apache.openejb.client.ClientRuntimeException;
 import org.apache.openejb.client.RemoteInitialContextFactory;
 import org.apache.openejb.jee.EnterpriseBean;
 import org.apache.openejb.jee.SingletonBean;
@@ -77,7 +76,7 @@ public class ZEjbdTest {
         remoteCall("zejbd");
     }
 
-    @Test(expected = ClientRuntimeException.class)
+    @Test(expected = NamingException.class)
     public void checkEjbdFailWithAGzipServer() throws Exception {
         remoteCall("ejbd");
     }

Reply via email to