You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Ariel Isaac (JIRA)" <ji...@apache.org> on 2015/10/07 19:29:26 UTC
[jira] [Commented] (SHIRO-513) Misleading error message when using
custom WebEnvironment
[ https://issues.apache.org/jira/browse/SHIRO-513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14947242#comment-14947242 ]
Ariel Isaac commented on SHIRO-513:
-----------------------------------
Then the solution would be just removing the Mutable part right and would be something like this
{code}
Class<?> clazz = determineWebEnvironmentClass(sc);
if (!WebEnvironment.class.isAssignableFrom(clazz)) {
throw new ConfigurationException("Custom WebEnvironment class [" + clazz.getName() +
"] is not of required type [" + WebEnvironment.class.getName() + "]");
}{code}
> Misleading error message when using custom WebEnvironment
> ---------------------------------------------------------
>
> Key: SHIRO-513
> URL: https://issues.apache.org/jira/browse/SHIRO-513
> Project: Shiro
> Issue Type: Bug
> Components: Web
> Affects Versions: 1.2.3
> Reporter: Andreas Kohn
> Priority: Trivial
>
> Found while reading the code in EnvironmentLoader#createEnvironment():
> {code}
> 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() + "]");
> }
> {code}
> The message says you need a WebEnvironment, the check (and later code) however requires _Mutable_WebEnvironment.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)