shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maria Jurcovicova (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SHIRO-288) Ini file loading from classpath
Date Tue, 03 May 2011 19:53:03 GMT

    [ https://issues.apache.org/jira/browse/SHIRO-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028387#comment-13028387
] 

Maria Jurcovicova commented on SHIRO-288:
-----------------------------------------

The reason seems to be following code in IniShiroFilter:

    public void setConfigPath(String configPath) {
        String path = StringUtils.clean(configPath);
        if (path != null) {
            path = WebUtils.normalize(path);
        }
        this.configPath = path;
    }

the line path = WebUtils.normalize(path); converts 'classpath:Shiro.ini' into '/classpath:Shiro.ini'.
Prefix '/' cause problem later in Ini convertPathToIni(String path) method on line 337.



> Ini file loading from classpath
> -------------------------------
>
>                 Key: SHIRO-288
>                 URL: https://issues.apache.org/jira/browse/SHIRO-288
>             Project: Shiro
>          Issue Type: Bug
>          Components: Web
>    Affects Versions: 1.2.0
>            Reporter: Maria Jurcovicova
>
> I have web application that uses Shiro version 1.2.0-SNAPSHOT with Shiro.ini file on
classpath. The application stopped to load ini file and returns an error: 
> There is no servlet context resource corresponding to configPath '/classpath:Shiro.ini'
 If the resource is located elsewhere (not immediately resolveable in the servlet context),
specify an appropriate classpath:, url:, or file: resource prefix accordingly.
> Extract of my Web.xml:
> 	<filter>
> 		<filter-name>ShiroFilter</filter-name>
> 		<filter-class>org.apache.shiro.web.servlet.IniShiroFilter</filter-class>
> 		<init-param>
> 			<param-name>configPath</param-name>
> 			<param-value>classpath:Shiro.ini</param-value>
> 		</init-param>
> 	</filter>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message