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;
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) {
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" );
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.XMLMemento;
import org.eclipse.ui.internal.Workbench;
+import org.springframework.remoting.RemoteAccessException;
import eu.etaxonomy.taxeditor.model.IContextListener;
import eu.etaxonomy.taxeditor.model.MementoHelper;
}
/**
* <p>notifyContextStart</p>
+ * @throws Throwable
*/
- public void notifyContextStart() {
+ public void notifyContextStart() throws RemoteAccessException {
MessagingUtils.info("Notifying context listeners, that the context has started.");
ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
}
});
} catch (InvocationTargetException e) {
- MessagingUtils.error(getClass(), e);
+ if (e.getTargetException().getClass().equals(RemoteAccessException.class)){
+ if (e.getTargetException().getMessage().contains("403")){
+ // new CdmAuthenticationException("Access Denied", e.getTargetException());
+ throw new CdmAuthenticationException("You are logged in now but you are not permitted to use the TaxEditor with the selected data source", e.getTargetException());
+ }else{
+ MessagingUtils.error(getClass(), e.getTargetException());
+ }
+ }else{
+ MessagingUtils.error(getClass(), e);
+ }
} catch (InterruptedException e) {
MessagingUtils.error(getClass(), e);
}
}
});
} catch (InvocationTargetException e) {
- MessagingUtils.error(getClass(), e);
+ if (e.getTargetException().getClass().equals(RemoteAccessException.class)){
+ if (e.getTargetException().getMessage().contains("403")){
+ MessagingUtils.confirmDialog("Access denied", "Access denied");
+ }else{
+ MessagingUtils.error(getClass(), e.getTargetException());
+ }
+ }else{
+ MessagingUtils.error(getClass(), e);
+ }
} catch (InterruptedException e) {
MessagingUtils.error(getClass(), e);
}