Examples of ServerException


Examples of br.com.caelum.restfulie.http.error.ServerException

      throw new NotImplementedException("Http error " + code
          + " when executing request");
    }

    if (code == 500 || (code >= 502 && code <= 599)) {
      throw new ServerException("Http error " + code
          + " when executing request");
    }

    throw new UnknowCodeException("http erro");
  }
View Full Code Here

Examples of cn.aprilsoft.TinyAppServer.exception.ServerException

    public static void executeJssp(File file, Request request, Response response) {
        File explained;
        try {
            explained = explainJssp(file);
        } catch (IOException e) {
            throw new ServerException(e);
        }
        executeExplained(explained, request, response);
    }
View Full Code Here

Examples of co.cask.cdap.common.service.ServerException

    ServerException {
    Discoverable endpoint = endpointStrategy.pick();
    if (endpoint == null) {
      String message = String.format("Service '%s' is not registered in discovery service.", serviceName);
      LOG.error(message);
      throw new ServerException(message);
    }
    TTransport transport = new TFramedTransport(
      new TSocket(endpoint.getSocketAddress().getHostName(), endpoint.getSocketAddress().getPort()));
    try {
      transport.open();
    } catch (TTransportException e) {
      String message = String.format("Unable to connect to thrift service %s at %s. Reason: %s",
                                     serviceName, endpoint.getSocketAddress(), e.getMessage());
      LOG.error(message);
      throw new ServerException(message, e);
    }
    // now try to connect the thrift client
    return new TBinaryProtocol(transport);
  }
View Full Code Here

Examples of com.claymus.gwt.ServerException

    BlockType blockData = BlockData.getBlockType(blockDTO.getClass().getSimpleName().replace("DTO", ""));
    Block block = new Block(blockData, blockDTO.getLocation());
    block.update(blockDTO);
    block = BlockData.createBlock(block);
    if(block == null)
      throw new ServerException("Block could not be created. Please try again later.");
  }
View Full Code Here

Examples of com.claymus.gwt.ServerException

    Block block = BlockData.getBlock(key);

    int accessLevel = module.getAccessLevel(user.getRole());
    if(accessLevel >= ModuleHelper.ADD_EDIT || (accessLevel == ModuleHelper.ADD && block.getOwner().equals(user))) {
      if(BlockData.updateBlock(key, blockDTO) == null)
        throw new ServerException("Block could not be saved. Please try again later.");
    } else {
      throw new UserException();
    }
  }
View Full Code Here

Examples of com.claymus.gwt.ServerException

      for(int j = 0; j < blocks.size(); j++) {
        Block block = blocks.get(j);
        block = BlockData.updateBlockOrder(block.getKey(), weights.get(j), locations.get(i));
        if(block == null)
          throw new ServerException("Operation failed partially or fully. <a href=''>Refresh</a> the page to see the changes.");
      }
    }
  }
View Full Code Here

Examples of com.claymus.gwt.ServerException

    if(module.getAccessLevel(userRole) < ModuleHelper.VIEW_N_EDIT)
      throw new UserException();

    module = ModuleData.getModule(moduleId);
    if(module == null)
      throw new ServerException();

    module.setAccessLevel(UserData.getUserRole(KeyFactory.stringToKey(encoded)), accessLevel);
    if(! ModuleData.saveModule(module))
      throw new ServerException();
  }
View Full Code Here

Examples of com.claymus.gwt.ServerException

    if(module.getAccessLevel(userRole) != ModuleHelper.VIEW_N_CHANGE)
      throw new UserException();

    if(! ThemeData.setTheme(ThemeData.getTheme(className)))
      throw new ServerException("Theme could not be saved. Please try again.");
  }
View Full Code Here

Examples of com.ponysdk.ui.terminal.exception.ServerException

    protected void fireInstructions(final JSONObject data, final Request request, final Response response) throws Exception {
        final long key = data.getLong(APPLICATION.VIEW_ID);
        final Session session = request.getSession();
        final Application applicationSession = (Application) session.getAttribute(Application.class.getCanonicalName());

        if (applicationSession == null) { throw new ServerException(ServerException.INVALID_SESSION, "Invalid session, please reload your application (viewID #" + key + ")."); }

        final UIContext uiContext = applicationSession.getUIContext(key);

        if (uiContext == null) { throw new ServerException(ServerException.INVALID_SESSION, "Invalid session (no UIContext found), please reload your application (viewID #" + key + ")."); }

        uiContext.acquire();
        UIContext.setCurrent(uiContext);
        try {
            final Txn txn = Txn.get();
View Full Code Here

Examples of com.starlight.intrepid.exception.ServerException

      }
      catch( Exception ex ) {
        LOG.info( "Unable to de-serialize method argument", ex );
        // Write an error and return nothing
        session.write( new InvokeReturnIMessage( call_id,
          new ServerException( "Error de-serializing method argument", ex ),
          true, null, null ) );
        return null;
      }
    }

    // PERSISTENT NAME
    String persistent_name = null;
    if ( has_persistent_name ) {
      try {
        if ( DEBUG ) {
          System.out.println( "(In) Position before persistent name: " +
            buffer.position() );
        }

        persistent_name = buffer.getString( STRING_DECODER );

        if ( DEBUG ) {
          System.out.println( "  decoded persistent name: " + persistent_name );
          System.out.println( "(In) Position after persistent name: " +
            buffer.position() );
        }
      }
      catch ( CharacterCodingException ex ) {
        LOG.info( "Error decoding object persistent name", ex );
        // Write an error and return nothing
        session.write( new InvokeReturnIMessage( call_id,
          new ServerException( "Error decoding object persistent name", ex ),
          true, null, null ) );
        return null;
      }
    }

    // USER CONTEXT
    UserContextInfo user_context = null;
    if ( has_user_context ) {
      try {
        if ( DEBUG ) {
          System.out.println( "(In) Position before user context: " +
            buffer.position() );
          System.out.println( "Hex dump after context position: " +
            buffer.getHexDump() );
        }

        user_context =
          ( UserContextInfo ) IoBufferSerialization.getObject( buffer );
      }
      catch( Exception ex ) {
        LOG.info( "Error de-serializing user context", ex );
        // Write an error and return nothing
        session.write( new InvokeReturnIMessage( call_id,
          new ServerException( "Error de-serializing user context", ex ),
          true, null, null ) );
        return null;
      }
    }
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.