Examples of CannotConnectException


Examples of com.acrm.client.exception.CannotConnectException

    //t.printStackTrace();
    t=CRMUtils.getCaused(t);
    if(t instanceof ServerThrowException){
      return (InteractionException) t;
    }if(t instanceof ConnectException){
      return new CannotConnectException("Connect refused", 2);//连接被拒绝
    }else if(t instanceof SocketTimeoutException){//connect timed out 21    Read timed out 14
      return new CannotConnectException("Connect timed out",t, 1);//连接超时//网络不畅通
    }else if(t instanceof NoRouteToHostException){
      return new CannotConnectException("No routeto host", 0);//没有到主机的路由
    }else if(t instanceof SocketTimeoutException){
      return new CannotConnectException("Read timed out", 1);//读取数据超时
    }else if(t instanceof FileNotFoundException){
      return new ServerThrowException("Cannot connect to Server",t, 0);//连接失败,导致此异常极有可能服务端异常405
    }else{
      return new CannotConnectException("连接失败", t,0);
    }
  }
View Full Code Here

Examples of com.acrm.client.exception.CannotConnectException

    //t.printStackTrace();
    t=CRMUtils.getCaused(t);
    if(t instanceof ServerThrowException){
      return (InteractionException) t;
    }if(t instanceof ConnectException){
      return new CannotConnectException("Connect refused", 2);//连接被拒绝
    }else if(t instanceof SocketTimeoutException){//connect timed out 21    Read timed out 14
      return new CannotConnectException("Connect timed out",t, 1);//连接超时//网络不畅通
    }else if(t instanceof NoRouteToHostException){
      return new CannotConnectException("No routeto host", 0);//没有到主机的路由
    }else if(t instanceof SocketTimeoutException){
      return new CannotConnectException("Read timed out", 1);//读取数据超时
    }else if(t instanceof FileNotFoundException){
      return new ServerThrowException("Cannot connect to Server",t, 0);//连接失败,导致此异常极有可能服务端异常405
    }else{
      return new CannotConnectException("连接失败", t,0);
    }
  }
View Full Code Here

Examples of org.jboss.remoting.CannotConnectException

         Object result = resultHolder.value;
         if (result == null)
         {
            if (log.isDebugEnabled()) log.debug("invocation timed out");
            Exception cause = new SocketTimeoutException("timed out");
            throw new CannotConnectException("Can not connect http client invoker.", cause);
         }
         else if (result instanceof IOException)
         {
            throw (IOException) result;
         }
View Full Code Here

Examples of org.jboss.remoting.CannotConnectException

         }
         catch (IOException e1)
         {
            log.debug("Unable to retrieve response message", e1);
         }
         throw new CannotConnectException(message, e);
      }

      // now check for error response and throw exception unless configured to not do so
      if(responseCode >= 400
            || (getLocator().getProtocol().indexOf("servlet") >= 0
View Full Code Here

Examples of org.jboss.remoting.CannotConnectException

         {
//            if (bailOut)
//               return null;
            semaphore.release();
            if (trace) log.trace(this + " released semaphore: " + semaphore.permits());
            throw new CannotConnectException(
               "Can not get connection to server. Problem establishing " +
               "socket connection for " + locator, e);
         }

         if (tempTimeout >= 0)
View Full Code Here

Examples of org.jboss.remoting.CannotConnectException

      }
      catch(Exception e)
      {
         connected = false;
         log.debug("Error connecting RMI invoker client.", e);
         throw new CannotConnectException("Error connecting RMI invoker client", e);
      }
   }
View Full Code Here

Examples of org.jboss.remoting.CannotConnectException

   {
      if(this.server == null)
      {
         log.error("Server stub has not been set in RMI invoker client.  See previous errors for details.");
         //throw new IOException("Server stub hasn't been set!");
         throw new CannotConnectException("Server stub has not been set.");
      }
      try
      {

         Object payload = invocation;
         if(marshaller != null && !(marshaller instanceof RMIMarshaller))
         {
            if(marshaller instanceof MarshallerDecorator)
            {
               payload = ((MarshallerDecorator) marshaller).addDecoration(payload);
            }
            else
            {
               ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
               if (marshaller instanceof VersionedMarshaller)
                  ((VersionedMarshaller) marshaller).write(payload, byteOut, Version.getDefaultVersion());
               else
                  marshaller.write(payload, byteOut);
               ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut.toByteArray());
               ObjectInputStream ois = new ObjectInputStream(byteIn);

               try
               {
                  byteOut.close();
                  payload = ois.readObject();
                  ois.close();
               }
               catch(ClassNotFoundException e)
               {
                  log.error("Could not marshall invocation payload object " + payload, e);
                  throw new IOException(e.getMessage());
               }
            }

         }

         Object response = server.transport(payload);

         /* Jira Issue: JBREM-167
         if(unmarshaller != null && !(unmarshaller instanceof RMIUnMarshaller))
         {
            PipedOutputStream pos = new PipedOutputStream();
            PipedInputStream pis = new PipedInputStream();
            pos.connect(pis);
            ObjectOutputStream oos = new ObjectOutputStream(pos);
            oos.writeObject(response);
            oos.flush();
            oos.reset();
            oos.writeObject(Boolean.TRUE);
            oos.flush();
            oos.reset();
            try
            {
               oos.close();
               response = unmarshaller.read(pis, metadata);
               pis.close();
            }
            catch(ClassNotFoundException e)
            {
               log.error("Could not unmarshall invocation response" + response, e);
               throw new IOException(e.getMessage());
            }

         }
         */

         return response;
      }
      catch(RemoteException e)
      {
         log.error(e);
         throw new CannotConnectException("Error making invocation in RMI client invoker.", e);
      }
   }
View Full Code Here

Examples of org.jboss.remoting.CannotConnectException

         Object result = resultHolder.value;
         if (result == null)
         {
            if (log.isDebugEnabled()) log.debug("invocation timed out");
            Exception cause = new SocketTimeoutException("timed out");
            throw new CannotConnectException("Can not connect http client invoker.", cause);
         }
         else if (result instanceof IOException)
         {
            throw (IOException) result;
         }
View Full Code Here

Examples of org.jboss.remoting.CannotConnectException

         }
      }
      catch (Exception e)
      {
         log.debug("Error invoking http client invoker.", e);
         throw new CannotConnectException("Can not connect http client invoker.", e);
      }

      // now check for error response and throw exception unless configured to not do so
      if(responseCode >= 400
            || (getLocator().getProtocol().indexOf("servlet") >= 0
View Full Code Here

Examples of org.jboss.remoting.CannotConnectException

      if (server == null)
      {
         String message = this + " unable to connect RMI invoker client";
         log.debug(message);
         throw new CannotConnectException(message, savedException);
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.