ref #7993: missed to commit some changes to catch 403 Exceptiojn
[taxeditor.git] / eu.etaxonomy.taxeditor.cdmlib / src / main / java / eu / etaxonomy / taxeditor / service / CdmServiceRequestExecutor.java
index 783845df10ad827d29ee6bc422043d5119a80c43..90fab0c977fb8f80abb61b2f978e95bd4412fca4 100644 (file)
@@ -5,6 +5,7 @@ import java.io.OutputStream;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.http.NoHttpResponseException;
 import org.apache.log4j.Logger;
 import org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration;
 import org.springframework.remoting.support.RemoteInvocation;
@@ -50,7 +51,7 @@ public class CdmServiceRequestExecutor extends CdmAuthenticatedHttpInvokerReques
        protected RemoteInvocationResult doExecuteRequest(HttpInvokerClientConfiguration config,
                        java.io.ByteArrayOutputStream baos)
                                        throws java.io.IOException,
-                                       java.lang.ClassNotFoundException {
+                                       java.lang.ClassNotFoundException, NoHttpResponseException {
                RemoteInvocationResult rir = fromCache(currentRemoteInvocation);
 
                if(rir == null) {
@@ -58,7 +59,13 @@ public class CdmServiceRequestExecutor extends CdmAuthenticatedHttpInvokerReques
                    if (!(currentRemoteInvocation.getMethodName() == null) && !(config.getServiceUrl() == null)){
                       // logger.info("Remote invoking : " + currentRemoteInvocation.getMethodName() + "@" + config.getServiceUrl());
                    }
-                   rir = super.doExecuteRequest(config, baos);
+                   try{
+                       rir = super.doExecuteRequest(config, baos);
+                   }catch(Exception e){
+                       if (e instanceof NoHttpResponseException){
+                          throw e;
+                       }
+                   }
                        if(rir.getValue() != null && !rir.hasException()) {
                            if (currentRemoteInvocation == null){
                                logger.debug("return RemoteInvocationResult without caching" );