Examples of ServiceException


Examples of com.cedarsolutions.exception.ServiceException

        return ExceptionUtils.addExceptionContext(exception, 1);
    }

    /** Create a service exception, filling in exception context. */
    public static ServiceException createServiceException(String message) {
        ServiceException exception = new ServiceException(message);
        return ExceptionUtils.addExceptionContext(exception, 1);
    }

Examples of com.cedarsolutions.exception.ServiceException

        return ExceptionUtils.addExceptionContext(exception, 1);
    }

    /** Create a service exception, filling in exception context. */
    public static ServiceException createServiceException(LocalizableMessage localizableMessage) {
        ServiceException exception = new ServiceException(localizableMessage);
        return ExceptionUtils.addExceptionContext(exception, 1);
    }

Examples of com.cedarsolutions.exception.ServiceException

        return ExceptionUtils.addExceptionContext(exception, 1);
    }

    /** Create a service exception, filling in exception context. */
    public static ServiceException createServiceException(String message, Throwable cause) {
        ServiceException exception = new ServiceException(message, cause);
        return ExceptionUtils.addExceptionContext(exception, 1);
    }

Examples of com.cedarsolutions.exception.ServiceException

        return ExceptionUtils.addExceptionContext(exception, 1);
    }

    /** Create a service exception, filling in exception context. */
    public static ServiceException createServiceException(LocalizableMessage localizableMessage, Throwable cause) {
        ServiceException exception = new ServiceException(localizableMessage, cause);
        return ExceptionUtils.addExceptionContext(exception, 1);
    }

Examples of com.cedarsolutions.exception.ServiceException

    }

    /** Wrap any unexpected exception from an RPC method call in a ServiceException. */
    @Override
    protected void doUnexpectedFailure(Throwable exception) {
        throw new ServiceException("Unexpected failure in service call: " + exception.getMessage(), exception);
    }

Examples of com.cloudera.lib.server.ServiceException

    for (Map.Entry<String, String> entry : getServiceConfig()) {
      String key = entry.getKey();
      if (key.endsWith(GROUPS)) {
        String proxyUser = key.substring(0, key.lastIndexOf(GROUPS));
        if (getServiceConfig().get(proxyUser + HOSTS) == null) {
          throw new ServiceException(ERROR.PRXU02, getPrefixedName(proxyUser + HOSTS));
        }
        String value = entry.getValue().trim();
        LOG.info("Loading proxyuser settings [{}]=[{}]", key, value);
        Set<String> values = null;
        if (!value.equals("*")) {
          values = new HashSet<String>(Arrays.asList(value.split(",")));
        }
        proxyUserGroups.put(proxyUser, values);
      }
      if (key.endsWith(HOSTS)) {
        String proxyUser = key.substring(0, key.lastIndexOf(HOSTS));
        if (getServiceConfig().get(proxyUser + GROUPS) == null) {
          throw new ServiceException(ERROR.PRXU02, getPrefixedName(proxyUser + GROUPS));
        }
        String value = entry.getValue().trim();
        LOG.info("Loading proxyuser settings [{}]=[{}]", key, value);
        Set<String> values = null;
        if (!value.equals("*")) {
          String[] hosts = value.split(",");
          for (int i = 0; i < hosts.length; i++) {
            String originalName = hosts[i];
            try {
              hosts[i] = normalizeHostname(originalName);
            }
            catch (Exception ex) {
              throw new ServiceException(ERROR.PRXU01, originalName, ex.getMessage(), ex);
            }
            LOG.info("  Hostname, original [{}], normalized [{}]", originalName, hosts[i]);
          }
          values = new HashSet<String>(Arrays.asList(hosts));
        }

Examples of com.cloudera.lib.server.ServiceException

    if (security.equals("kerberos")) {
      String defaultName = getServer().getName();
      String keytab = System.getProperty("user.home") + "/" + defaultName + ".keytab";
      keytab = getServiceConfig().get(KERBEROS_KEYTAB, keytab).trim();
      if (keytab.length() == 0) {
        throw new ServiceException(HadoopException.ERROR.H01, KERBEROS_KEYTAB);
      }
      String principal = defaultName + "/localhost@LOCALHOST";
      principal = getServiceConfig().get(KERBEROS_PRINCIPAL, principal).trim();
      if (principal.length() == 0) {
        throw new ServiceException(HadoopException.ERROR.H01, KERBEROS_PRINCIPAL);
      }
      Configuration conf = new Configuration();
      conf.set("hadoop.security.authentication", "kerberos");
      UserGroupInformation.setConfiguration(conf);
      try {
        UserGroupInformation.loginUserFromKeytab(principal, keytab);
      }
      catch (IOException ex) {
        throw new ServiceException(HadoopException.ERROR.H02, ex.getMessage(), ex);
      }
      LOG.info("Using Hadoop Kerberos authentication, principal [{}] keytab [{}]", principal, keytab);
    }
    else if (security.equals("simple")) {
      Configuration conf = new Configuration();
      conf.set("hadoop.security.authentication", "simple");
      UserGroupInformation.setConfiguration(conf);
      LOG.info("Using Hadoop simple/pseudo authentication, principal [{}]", System.getProperty("user.name"));
    }
    else {
      throw new ServiceException(HadoopException.ERROR.H09, security);
    }

    serviceHadoopConf = new XConfiguration();
    for (Map.Entry entry : getServiceConfig()) {
      String name = (String) entry.getKey();

Examples of com.gatehill.apibms.core.exception.ServiceException

            try {
                port = ServerUtil.getFreePort();
                LOGGER.debug("No port specified - got free port {}", port);

            } catch (IOException e) {
                throw new ServiceException("Error getting free port", e);
            }
        }

        if (null != running.get(port)) {
            throw new ServiceException("Server already running on port " + port);
        }

        final Undertow server = Undertow.builder()
                .addHttpListener(port, host)
                .setHandler(new HttpHandler() {

Examples of com.gcrm.exception.ServiceException

    public User findByName(String username) throws ServiceException {
        User user;
        try {
            user = this.userDao.findByName(username);
        } catch (DaoException e) {
            throw new ServiceException(e);
        }

        return user;
    }

Examples of com.github.dactiv.showcase.service.ServiceException

    User user = SystemVariableUtils.getSessionVariable().getUser();
   
    oldPassword = new SimpleHash("MD5", oldPassword.toCharArray()).toString();
   
    if (!user.getPassword().equals(oldPassword)) {
      throw new ServiceException("旧密码不正确.");
    }
   
    accountManager.updateUserPassword(user,newPassword);
     
    return "redirect:/logout";
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.