Package org.apache.shiro.config

Examples of org.apache.shiro.config.ConfigurationException


      // XXX this ugly hack is because action is not an authorizeable
      if(!section.toLowerCase().startsWith(PRIVILEGE_PREFIX)) {
        Authorizable authorizable = Authorizables.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


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

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

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

                if (key instanceof FilterConfigKey) {
                    FilterConfigKey<? extends PathMatchingFilter> configKey = (FilterConfigKey<? extends PathMatchingFilter>) key;
                    key = configKey.getKey();
                    filterChain.getValue()[i] = key;
                    if (!PathMatchingFilter.class.isAssignableFrom(key.getTypeLiteral().getRawType())) {
                        throw new ConfigurationException("Config information requires a PathMatchingFilter - can't apply to " + key.getTypeLiteral().getRawType());
                    }
                    configs.put(castToPathMatching(key), filterChain.getKey(), configKey.getConfigValue());
                } else if (PathMatchingFilter.class.isAssignableFrom(key.getTypeLiteral().getRawType())) {
                    configs.put(castToPathMatching(key), filterChain.getKey(), "");
                }
View Full Code Here

     */
    protected void bindWebSecurityManager(AnnotatedBindingBuilder<? super WebSecurityManager> bind) {
        try {
            bind.toConstructor(DefaultWebSecurityManager.class.getConstructor(Collection.class)).asEagerSingleton();
        } catch (NoSuchMethodException e) {
            throw new ConfigurationException("This really shouldn't happen.  Either something has changed in Shiro, or there's a bug in ShiroModule.", e);
        }
    }
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

           
            return new String[]{name, config};

        } catch (Exception e) {
            String msg = "Unable to parse filter chain definition token: " + token;
            throw new ConfigurationException(msg, e);
        }
    }
View Full Code Here

                //this is an erroneous config:
                String msg = "chainSpecificFilterConfig was specified, but the underlying " +
                        "Filter instance is not an 'instanceof' " +
                        PathConfigProcessor.class.getName() + ".  This is required if the filter is to accept " +
                        "chain-specific configuration.";
                throw new ConfigurationException(msg);
            }
        }
    }
View Full Code Here

                    "initialization can occur.");
        }
        try {
            filter.init(filterConfig);
        } catch (ServletException e) {
            throw new ConfigurationException(e);
        }
    }
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.