Package org.apache.shiro.config

Examples of org.apache.shiro.config.ConfigurationException


          foundDatabaseInAuthorizables = true;
        }
        if (authorizable instanceof AccessURI) {
          if (foundDatabaseInAuthorizables) {
            String msg = "URI object is specified at DB scope in " + privilege;
            throw new ConfigurationException(msg);
          }
          foundURIInAuthorizables = true;
        }
      }
      if(!foundDatabaseInAuthorizables && !(foundURIInAuthorizables && allowURIInAuthorizables)) {
        String msg = "Missing database object in " + privilege;
        throw new ConfigurationException(msg);
      }
    }
  }
View Full Code Here


    Iterable<DBModelAuthorizable> authorizables = parsePrivilege(privilege);
    for(DBModelAuthorizable authorizable : authorizables) {
      if(authorizable instanceof Server &&
          authorizable.getName().equals(Server.ALL.getName())) {
        String msg = "Invalid value for " + authorizable.getAuthzType() + " in " + privilege;
        throw new ConfigurationException(msg);
      }
    }
  }
View Full Code Here

    Iterable<DBModelAuthorizable> authorizables = parsePrivilege(privilege);
    for(DBModelAuthorizable authorizable : authorizables) {
      if(authorizable instanceof Server && !serverName.equalsIgnoreCase(authorizable.getName())) {
        String msg = "Server name " + authorizable.getName() + " in "
            + privilege + " is invalid. Expected " + serverName;
        throw new ConfigurationException(msg);
      }
    }
  }
View Full Code Here

        if(authorizable instanceof Database &&
            !database.equalsIgnoreCase(authorizable.getName())) {
          String msg = "Privilege " + privilege + " references db " +
              authorizable.getName() + ", but is only allowed to reference "
              + database;
          throw new ConfigurationException(msg);
        }
      }
    }
  }
View Full Code Here

      // XXX this ugly hack is because action is not an authorizeable
      if(!section.toLowerCase().startsWith(PRIVILEGE_PREFIX)) {
        DBModelAuthorizable authorizable = DBModelAuthorizables.from(section);
        if(authorizable == null) {
          String msg = "No authorizable found for " + section;
          throw new ConfigurationException(msg);
        }
        result.add(authorizable);
      }
    }
    return result;
View Full Code Here

      // XXX this ugly hack is because action is not an authorizable
      if(!section.toLowerCase().startsWith(PRIVILEGE_PREFIX)) {
        SearchModelAuthorizable authorizable = SearchModelAuthorizables.from(section);
        if(authorizable == null) {
          String msg = "No authorizable found for " + section;
          throw new ConfigurationException(msg);
        }
        result.add(authorizable);
      }
    }
    return result;
View Full Code Here

    protected InputStream getCacheManagerConfigFileInputStream() {
        String configFile = getCacheManagerConfigFile();
        try {
            return ResourceUtils.getInputStreamForPath(configFile);
        } catch (IOException e) {
            throw new ConfigurationException("Unable to obtain input stream for cacheManagerConfigFile [" +
                    configFile + "]", e);
        }
    }
View Full Code Here

            case NO_SALT:
                password = getPasswordForUser(conn, username)[0];
                break;
            case CRYPT:
                // TODO: separate password and hash from getPasswordForUser[0]
                throw new ConfigurationException("Not implemented yet");
                //break;
            case COLUMN:
                String[] queryResults = getPasswordForUser(conn, username);
                password = queryResults[0];
                salt = queryResults[1];
View Full Code Here

        String className = servletContext.getInitParameter(ENVIRONMENT_CLASS_PARAM);
        if (className != null) {
            try {
                return ClassUtils.forName(className);
            } catch (UnknownClassException ex) {
                throw new ConfigurationException(
                        "Failed to load custom WebEnvironment class [" + className + "]", ex);
            }
        } else {
            return IniWebEnvironment.class;
        }
View Full Code Here

     */
    protected WebEnvironment createEnvironment(ServletContext sc) {

        Class<?> clazz = determineWebEnvironmentClass(sc);
        if (!MutableWebEnvironment.class.isAssignableFrom(clazz)) {
            throw new ConfigurationException("Custom WebEnvironment class [" + clazz.getName() +
                    "] is not of required type [" + WebEnvironment.class.getName() + "]");
        }

        String configLocations = sc.getInitParameter(CONFIG_LOCATIONS_PARAM);
        boolean configSpecified = StringUtils.hasText(configLocations);

        if (configSpecified && !(ResourceConfigurable.class.isAssignableFrom(clazz))) {
            String msg = "WebEnvironment class [" + clazz.getName() + "] does not implement the " +
                    ResourceConfigurable.class.getName() + "interface.  This is required to accept any " +
                    "configured " + CONFIG_LOCATIONS_PARAM + "value(s).";
            throw new ConfigurationException(msg);
        }

        MutableWebEnvironment environment = (MutableWebEnvironment) ClassUtils.newInstance(clazz);

        environment.setServletContext(sc);
View Full Code Here

TOP

Related Classes of org.apache.shiro.config.ConfigurationException

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.