TOP

shiro:Wildcard string cannot be null or empty. Make sure permission strings are properly formatted.(三)
2017-10-12 18:17:15 】 浏览:11148次 本网站的内容取自网络,仅供学习参考之用,绝无侵犯任何人知识产权之意。如有侵犯请您及时与本人取得联系,万分感谢。
Tags:shiro:Wildcard string cannot null empty. Make sure permission strings are properly formatted.

va:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineva lve.invoke(StandardEngineva lve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1778) at java.lang.Thread.run(Thread.java:745)

  

查看一下WildcardPermission.java源代码:

  protected void setParts(String wildcardString, boolean caseSensitive) {
        wildcardString = StringUtils.clean(wildcardString);
        if(wildcardString != null && !wildcardString.isEmpty()) {
            List parts = CollectionUtils.asList(wildcardString.split(":"));
            this.parts = new ArrayList();
            Iterator i$ = parts.iterator();

            while(i$.hasNext()) {
                String part = (String)i$.next();
                Set subparts = CollectionUtils.asSet(part.split(","));
                if(!caseSensitive) {
                    subparts = this.lowercase(subparts);
                }

                if(subparts.isEmpty()) {
                    throw new IllegalArgumentException("Wildcard string cannot contain parts with only dividers. Make sure permission strings are properly formatted.");
                }

                this.parts.add(subparts);
            }

            if(this.parts.isEmpty()) {
                throw new IllegalArgumentException("Wildcard string cannot contain only dividers. Make sure permission strings are properly formatted.");
            }
        } else {
            throw new IllegalArgumentException("Wildcard string cannot be null or empty. Make sure permission strings are properly formatted.");
        }
    }

  因为不留神将空值插入到权限信息中,结果抛出以上异常。

去掉空值后正常。

java.lang.IllegalArgumentException: Wildcard string cannot be null or empty. Make sure permission strings are properly formatted.at org.apache.shiro.authz.permission.WildcardPermission.setParts(WildcardPermission.java:154)at org.apache.shiro.authz.permission.WildcardPermission.<init>(WildcardPermission.java:143)at org.apache.shiro.authz.permission.WildcardPermission.<init>(WildcardPermission.java:139)at org.apache.shiro.authz.permission.WildcardPermissionResolver.resolvePermission(WildcardPermissionResolver.java:41)at org.apache.shiro.realm.AuthorizingRealm.resolvePermissions(AuthorizingRealm.java:434)at org.apache.shiro.realm.AuthorizingRealm.getPermissions(AuthorizingRealm.java:410)at org.apache.shiro.realm.AuthorizingRealm.isPermitted(Autho

请关注公众号获取更多资料


shiro:Wildcard string cannot be null or empty. Make sure permission strings are properly formatted.(三) https://www.cppentry.com/bencandy.php?fid=76&id=153843

首页 上一页 1 2 3 4 5 6 下一页 尾页 3/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Java中常见数据结构List之ArrayLi.. 下一篇解读java同步类CountDownLatch

评论

验 证 码:
表  情:
内  容: