Package java.rmi

Examples of java.rmi.ServerException


                     continue;
                  }
                  else
                  {
                     invocationHasReachedAServer(invocation);
                     throw new ServerException("Clustering error", gcex);
                  }
               }
               else
               {
                  throw ((Exception) response);
               }
            }
            if(response instanceof MarshalledObject<?>)
            {
               haResponse = (HARMIResponse) ((MarshalledObject<?>) response).get();
            }
            else
            {
               haResponse = (HARMIResponse) response;
            }

            // check for clustered targets
            if(haResponse.newReplicants != null)
            {
               updateClusterInfo(haResponse.newReplicants, haResponse.currentViewId);
            }
           
            response = haResponse.response;
            invocationHasReachedAServer(invocation);
            return response;

         }
         catch(CannotConnectException cncEx)
         {
            if (trace)
            {
               log.trace("Invocation failed: CannotConnectException - " + cncEx, cncEx);
            }
           
            removeDeadTarget(getLocator());
            resetView();
            failoverAuthorized = txContextAllowsFailover(invocation);

            failoverCounter++;
            invocation.setValue("FAILOVER_COUNTER", new Integer(failoverCounter), PayloadKey.AS_IS);
         }
         catch(GenericClusteringException gcex)
         {
            lastException = gcex;
            // this is a generic clustering exception that contain the
            // completion status: usefull to determine if we are authorized
            // to re-issue a query to another node
            //
            if(gcex.getCompletionStatus() == GenericClusteringException.COMPLETED_NO)
            {
               // we don't want to remove the node from the list of failed
               // node UNLESS there is a risk to indefinitively loop
               //
               if(totalNumberOfTargets() >= failoverCounter)
               {
                  if(!gcex.isDefinitive())
                  {
                     definitivlyRemoveNodeOnFailure = false;
                  }
               }
               removeDeadTarget(getLocator());
               if(!definitivlyRemoveNodeOnFailure)
               {
                  resetView();
               }
               failoverAuthorized = txContextAllowsFailover(invocation);

               failoverCounter++;
               invocation.setValue("FAILOVER_COUNTER", new Integer(failoverCounter), PayloadKey.AS_IS);
              
               if (trace)
               {
                  log.trace("Received GenericClusteringException where request was not completed.  Will retry.");
               }
            }
            else
            {
               invocationHasReachedAServer(invocation);
               throw new ServerException("Clustering error", gcex);
            }
         }
         catch(RemoteException aex)
         {
            if (trace)
            {
               log.trace("Invocation failed: RemoteException - " + aex, aex);
            }

            // per Jira issue JBREM-61
            if(isStrictRMIException())
            {
               throw new ServerException(aex.getMessage(), aex);
            }
            else
            {
               throw aex;
            }
View Full Code Here


            }
      }
      else
      {
         invocationHasReachedAServer(invocation);
         throw new ServerException("Clustering error", gce);
      }
      return definitivlyRemoveNodeOnFailure;
   }
View Full Code Here

            Throwable orig = ((UnknownException) ex).originalEx;
            if (orig instanceof Error) {
                return new ServerError("Error occurred in server thread",
                        (Error) orig);
            } else if (orig instanceof RemoteException) {
                return new ServerException(
                        "RemoteException occurred in server thread",
                        (Exception) orig);
            } else if (orig instanceof RuntimeException) {
                throw (RuntimeException) orig;
            }
View Full Code Here

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        try {
            processRequest(request, response);
        } catch (TwitterException ex) {
            throw new ServerException("TwitterException", ex);
        }
    }
View Full Code Here

    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        try {
            processRequest(request, response);
        } catch (TwitterException ex) {
            throw new ServerException("TwitterException", ex);
        }
    }
View Full Code Here

     new FailingOpCountingOwner(badObjException01, 0, renewGrant);

       /* 04) any instance of a java.rmi.ServerException in which the value
    of the exception's detail field is a bad object invocation */
       badObjException04 =
     new ServerException("LeaseExpirationTest", badObjException02);
       badObjOwner04 =
     new FailingOpCountingOwner(badObjException04, 0, renewGrant);

       /* 05) any instance of a java.lang.Error unless it is an instance of
    java.lang.LinkageError or java.lang.OutOfMemoryError */
       badObjException05 =
     new StackOverflowError("LeaseExpirationTest");
       badObjOwner05 =
     new FailingOpCountingOwner(badObjException05, 0, renewGrant);

       // create owners for testing bad invocation exceptions
      
       /* 01) any instance of java.rmi.MarshalException in which the
          value of the exception's detail field is an instance of
          java.io.ObjectStreamException */
       badInvException01 =
     new MarshalException("LeaseExpirationTest",
      new StreamCorruptedException("LeaseExpirationTest"));
       badInvOwner01 =
     new FailingOpCountingOwner(badInvException01, 0, renewGrant);

       /* 02) any instance of java.rmi.UnmarshalException in which the
          value of the exception's detail field is an instance of
          java.io.ObjectStreamException */
       badInvException02 =
     new UnmarshalException("LeaseExpirationTest",
      new StreamCorruptedException("LeaseExpirationTest"));
       badInvOwner02 =
     new FailingOpCountingOwner(badInvException02, 0, renewGrant);

       /* 03) any instance of java.rmi.ServerException in which the
          value of the exception's detail field is a bad invocation
          exception. */
       badInvException03 =
     new ServerException("LeaseExpirationTest", badInvException01);
       badInvOwner03 =
     new FailingOpCountingOwner(badInvException03, 0, renewGrant);

       // create owners for testing bad indefinite exceptions

       /* 01) any instance of a java.rmi.RemoteException except those
          that can be classified as either a bad invocation or bad
          object exception. */
       indefiniteException01 =
     new ConnectException("LeaseExpirationTest");
       indefiniteOwner01 =
     new FailingOpCountingOwner(indefiniteException01, 0, renewGrant);

       // 02) any instance of a java.lang.OutOfMemoryError
       indefiniteException02 = new OutOfMemoryError("LeaseExpirationTest");
       indefiniteOwner02 =
     new FailingOpCountingOwner(indefiniteException02, 0, renewGrant);
      
       // 03) any instance of a java.lang.LinkageError
       indefiniteException03 = new NoSuchFieldError("LeaseExpirationTest");
       indefiniteOwner03 =
     new FailingOpCountingOwner(indefiniteException03, 0, renewGrant);
      
       // 04) assert that 02 is true inside of a ServerError
       indefiniteException04 = new ServerError("LeaseExpirationTest",
                 indefiniteException02);
       indefiniteOwner04 =
     new FailingOpCountingOwner(indefiniteException04, 0, renewGrant);

       // 05) assert that 03 is true inside of a ServerError
       indefiniteException05 = new ServerError("LeaseExpirationTest",
                 indefiniteException03);
       indefiniteOwner05 =
     new FailingOpCountingOwner(indefiniteException05, 0, renewGrant);

       // 06) assert that 01 is true inside of a ServerException
       indefiniteException06 = new ServerException("LeaseExpirationTest",
               indefiniteException01);
       indefiniteOwner06 =
     new FailingOpCountingOwner(indefiniteException06, 0, renewGrant);

       // create lease renewal manager for wider use across implementations
View Full Code Here

      _volumeDao.remove(volume.getId());
      txn.commit();

    } catch (UnknownHostException uhe) {
      s_logger.warn("Unable to delete volume on filer " , uhe);
      throw new ServerException("Unable to delete volume on filer", uhe);
    }catch (NaAPIFailedException naf) {
      s_logger.warn("Unable to delete volume on filer " , naf);
      if( naf.getErrno() == 13040 ){
        s_logger.info("Deleting the volume: " + volName);
        _volumeDao.remove(volume.getId());
        txn.commit();
      }
     
      throw new ServerException("Unable to delete volume on filer", naf);
    }
    catch (NaException nae) {
      txn.rollback();
      s_logger.warn("Unable to delete volume on filer " , nae);
      throw new ServerException("Unable to delete volume on filer", nae);
    } catch (IOException ioe) {
      txn.rollback();
      s_logger.warn("Unable to delete volume on filer " , ioe);
      throw new ServerException("Unable to delete volume on filer", ioe);
    }
    finally
    {
      if (pool != null) {
        _poolDao.releaseFromLockTable(pool.getId());
View Full Code Here

      if(volumeCreated) {
        try {
          deleteRogueVolume(volName, s);//deletes created volume on filer
        } catch (NaException e) {
          s_logger.warn("Failed to cleanup created volume whilst rolling back on the netapp filer:", e);
          throw new ServerException("Unable to create volume via cloudtools."+"Failed to cleanup created volume on netapp filer whilst rolling back on the cloud db:", e);
        } catch (IOException e) {
          s_logger.warn("Failed to cleanup created volume whilst rolling back on the netapp filer:", e);
          throw new ServerException("Unable to create volume via cloudtools."+"Failed to cleanup created volume on netapp filer whilst rolling back on the cloud db:", e);
        }
      }
      throw new ServerException("Unable to create volume", nae);
    } catch (IOException ioe) {
      s_logger.warn("Failed to create volume on the netapp filer:", ioe);
      txn.rollback();
      if(volumeCreated) {
        try {
          deleteRogueVolume(volName, s);//deletes created volume on filer
        } catch (NaException e) {
          s_logger.warn("Failed to cleanup created volume whilst rolling back on the netapp filer:", e);
          throw new ServerException("Unable to create volume via cloudtools."+"Failed to cleanup created volume on netapp filer whilst rolling back on the cloud db:", e);
        } catch (IOException e) {
          s_logger.warn("Failed to cleanup created volume whilst rolling back on the netapp filer:", e);
          throw new ServerException("Unable to create volume via cloudtools."+"Failed to cleanup created volume on netapp filer whilst rolling back on the cloud db:", e);
        }
      }
      throw new ServerException("Unable to create volume", ioe);
    }
    finally{
      if (s != null)
        s.close();
      if (pool != null)
View Full Code Here

      StringBuilder sB = new StringBuilder();
      sB.append(weeks).append(" ").append(days).append(" ").append(hours).append("@").append(whichHours).append(" ").append(minutes).append("@").append(whichMinutes);
      return sB.toString();
    } catch (NaException nae) {
      s_logger.warn("Failed to get volume size ", nae);
      throw new ServerException("Failed to get volume size", nae);
    } catch (IOException ioe) {
      s_logger.warn("Failed to get volume size ", ioe);
      throw new ServerException("Failed to get volume size", ioe);
    }
    finally{
      if (s != null)
        s.close();
    }
View Full Code Here

      }
       
     
    } catch (NaException nae) {
      s_logger.warn("Failed to get volume size ", nae);
      throw new ServerException("Failed to get volume size", nae);
    } catch (IOException ioe) {
      s_logger.warn("Failed to get volume size ", ioe);
      throw new ServerException("Failed to get volume size", ioe);
    }
    finally{
      if (s != null)
        s.close();
    }
View Full Code Here

TOP

Related Classes of java.rmi.ServerException

Copyright © 2018 www.massapicom. 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.