访问某页面时,出现了这个异常:

  1. java.lang.IllegalArgumentException: Wildcard string cannot be null or empty. Make sure permission strings are properly formatted.
  2. at org.apache.shiro.authz.permission.WildcardPermission.setParts(WildcardPermission.java:154)
  3. at org.apache.shiro.authz.permission.WildcardPermission.<init>(WildcardPermission.java:143)
  4. at org.apache.shiro.authz.permission.WildcardPermission.<init>(WildcardPermission.java:139)
  5. at org.apache.shiro.authz.permission.WildcardPermissionResolver.resolvePermission(WildcardPermissionResolver.java:41)
  6. at org.apache.shiro.realm.AuthorizingRealm.resolvePermissions(AuthorizingRealm.java:434)
  7. at org.apache.shiro.realm.AuthorizingRealm.getPermissions(AuthorizingRealm.java:410)
  8. at org.apache.shiro.realm.AuthorizingRealm.isPermitted(AuthorizingRealm.java:468)
  9. at org.apache.shiro.realm.AuthorizingRealm.isPermitted(AuthorizingRealm.java:463)
  10. at org.apache.shiro.realm.AuthorizingRealm.isPermitted(AuthorizingRealm.java:458)
  11. at org.apache.shiro.authz.ModularRealmAuthorizer.isPermitted(ModularRealmAuthorizer.java:223)
  12. at org.apache.shiro.mgt.AuthorizingSecurityManager.isPermitted(AuthorizingSecurityManager.java:113)
  13. at org.apache.shiro.subject.support.DelegatingSubject.isPermitted(DelegatingSubject.java:158)
  14. at org.apache.shiro.web.tags.PermissionTag.isPermitted(PermissionTag.java:66)
  15. at org.apache.shiro.web.tags.HasPermissionTag.showTagBody(HasPermissionTag.java:32)
  16. at org.apache.shiro.web.tags.PermissionTag.onDoStartTag(PermissionTag.java:57)
  17. at org.apache.shiro.web.tags.SecureTag.doStartTag(SecureTag.java:53)
  18. at org.apache.jsp.WEB_002dINF.view.common.sysPermission.sysPermission_jsp._jspx_meth_shiro_005fhasPermission_005f0(sysPermission_jsp.java:486)
  19. at org.apache.jsp.WEB_002dINF.view.common.sysPermission.sysPermission_jsp._jspService(sysPermission_jsp.java:147)
  20. at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  21. at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  22. at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
  23. at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
  24. at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
  25. at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  26. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  27. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  28. at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
  29. at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
  30. at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
  31. at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
  32. at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:168)
  33. at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
  34. at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1244)
  35. at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027)
  36. at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971)
  37. at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
  38. at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
  39. at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
  40. at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
  41. at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
  42. at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  43. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  44. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  45. at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
  46. at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
  47. at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
  48. at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
  49. at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
  50. at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
  51. at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
  52. at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
  53. at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
  54. at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
  55. at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
  56. at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
  57. at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
  58. at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
  59. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  60. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  61. at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
  62. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  63. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  64. at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
  65. at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
  66. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  67. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  68. at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:107)
  69. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  70. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  71. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  72. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  73. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  74. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  75. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  76. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  77. at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
  78. at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617)
  79. at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1778)
  80. at java.lang.Thread.run(Thread.java:745)

  

查看一下WildcardPermission.java源代码:

  1. protected void setParts(String wildcardString, boolean caseSensitive) {
  2. wildcardString = StringUtils.clean(wildcardString);
  3. if(wildcardString != null && !wildcardString.isEmpty()) {
  4. List parts = CollectionUtils.asList(wildcardString.split(":"));
  5. this.parts = new ArrayList();
  6. Iterator i$ = parts.iterator();
  7.  
  8. while(i$.hasNext()) {
  9. String part = (String)i$.next();
  10. Set subparts = CollectionUtils.asSet(part.split(","));
  11. if(!caseSensitive) {
  12. subparts = this.lowercase(subparts);
  13. }
  14.  
  15. if(subparts.isEmpty()) {
  16. throw new IllegalArgumentException("Wildcard string cannot contain parts with only dividers. Make sure permission strings are properly formatted.");
  17. }
  18.  
  19. this.parts.add(subparts);
  20. }
  21.  
  22. if(this.parts.isEmpty()) {
  23. throw new IllegalArgumentException("Wildcard string cannot contain only dividers. Make sure permission strings are properly formatted.");
  24. }
  25. } else {
  26. throw new IllegalArgumentException("Wildcard string cannot be null or empty. Make sure permission strings are properly formatted.");
  27. }
  28. }

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

去掉空值后正常。

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(AuthorizingRealm.java:468)at org.apache.shiro.realm.AuthorizingRealm.isPermitted(AuthorizingRealm.java:463)at org.apache.shiro.realm.AuthorizingRealm.isPermitted(AuthorizingRealm.java:458)at org.apache.shiro.authz.ModularRealmAuthorizer.isPermitted(ModularRealmAuthorizer.java:223)at org.apache.shiro.mgt.AuthorizingSecurityManager.isPermitted(AuthorizingSecurityManager.java:113)at org.apache.shiro.subject.support.DelegatingSubject.isPermitted(DelegatingSubject.java:158)at org.apache.shiro.web.tags.PermissionTag.isPermitted(PermissionTag.java:66)at org.apache.shiro.web.tags.HasPermissionTag.showTagBody(HasPermissionTag.java:32)at org.apache.shiro.web.tags.PermissionTag.onDoStartTag(PermissionTag.java:57)at org.apache.shiro.web.tags.SecureTag.doStartTag(SecureTag.java:53)at org.apache.jsp.WEB_002dINF.view.common.sysPermission.sysPermission_jsp._jspx_meth_shiro_005fhasPermission_005f0(sysPermission_jsp.java:486)at org.apache.jsp.WEB_002dINF.view.common.sysPermission.sysPermission_jsp._jspService(sysPermission_jsp.java:147)at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:168)at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1244)at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027)at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971)at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.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.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.StandardEngineValve.invoke(StandardEngineValve.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)

[shiro] Wildcard string cannot be null or empty. Make sure permission strings are properly formatted.的更多相关文章

  1. (后端)shiro: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 su ...

  2. Check if a string is NULL or EMPTY using PowerShell

    http://techibee.com/powershell/check-if-a-string-is-null-or-empty-using-powershell/1889 Check if a s ...

  3. Summary: Difference between null and empty String

    String s1 = ""; means that the empty String is assigned to s1. In this case, s1.length() i ...

  4. (转)Java 中关于String的空对象(null) ,空值(empty),空格

    原文出处:Java 中关于String的空对象(null) ,空值(empty),空格 定义 空对象: String s = null; 空对象是指定义一个对象s,但是没有给该对象分配空间,即没有实例 ...

  5. PHP中空字符串介绍0、null、empty和false之间的关系

    PHP中空字符串介绍0.null.empty和false之间的关系 作者: 字体:[增加 减小] 类型:转载 时间:2012-09-25   用PHP开发那么久,PHP中空字符串.0.null.emp ...

  6. vb中的null.nothing.empty区别

    以下内容源自互联网: 变量 A.B.C.D 分别等于 0."".Null. Empty. Nothing 的哪一个? Dim A Dim B As String Dim C As ...

  7. VB (空字串)、Null、Empty、与 Nothing 的区别

    VB (空字串).Null.Empty.与 Nothing 的区别 http://blog.sina.com.cn/s/blog_3f39ffb50100bguw.html 变量 A.B.C.D 分别 ...

  8. php 0、null、empty和false之间的关系

    // 判断 0 与 ''.null.empty.false 之间的关系 $a = 0; echo "0 与 ''. empty.null.false 之间的关系:"; if($a ...

  9. PHP 中空字符串介绍0、null、empty和false之间的关系

    0是数字,是empty,是false,不是null,值相当于空字符串,但类型不是字符串,去空格或强制转换为字符串型时不等于空字符串 ""的值相当于0,是empty,是空字符串,是f ...

随机推荐

  1. 简明python教程 --C++程序员的视角(九):函数式编程、特殊类方法、测试及其他

    函数式编程 Lambda exec,eval和assert语句,repr函数   lambda语句 用来创建简短的单行匿名函数 print_assign = lambda name, value: n ...

  2. threeSum_0

    //找出数组中三个数相加为0,返回存在的组数 //输入指正*A,长度为size,返回*B和长度num int threeSum_0(int *A,int size,int *B,int &nu ...

  3. dedecms内容页调用缩略图 缩略图多种用法(借鉴)

    给大家分享一下文章内容页调用缩略图的方法. 这种问题是:文章有缩略图,但是文章里面没有,想把缩略图添加到文章里面. 1.文章内容页调用缩略图方法如下两种.第一种没有大小设置.原图显示.第二种.可以设大 ...

  4. Java线程的生命周期

    线程的生命周期包括:新建(New).就绪(Runnable).运行(Running).阻塞(Blocked)和死亡(Dead)5种状态.线程状态转换图如下: 1.新建状态(New) 当程序使用new关 ...

  5. Linux 线程--那一年, 我们一起忽视的pthread_join

    前言: 通过linux的pthread库, 相信大家对创建/销毁线程肯定很熟悉, 不过对pthread_join是否知道的更多呢?实验: 先编写一个常规的程序 #include <pthread ...

  6. HQL查询语言的使用介绍

    @SuppressWarnings("deprecation") public class HibernateUtil { private static final Session ...

  7. Sprint第二个冲刺(第三天)

    一.Sprint 计划会议:        今天我们召开了第二个Sprint的第三次会议,会议上我们把各自完成的情况进行了一次总结,现在主界面和美化按钮.增添图片的功能已经完成了,Doing里面的其他 ...

  8. AspxGridView

    转:出处 http://i.cnblogs.com/EditPosts.aspx?opt=1 AspxGridView点滴 1:页码设置 <SettingsPager>         & ...

  9. 《Java程序设计》第8周学习总结

    学号20145220 <Java程序设计>第8周学习总结 教材学习内容总结 15.1.1日志API简介 java.util.logging包提供了日志功能相关类与接口,不必额外配置日志组件 ...

  10. poj2912 带权并查集

    题意:多个人玩石头剪刀布,每个人提前选定了自己出哪个手势,而其中有一种特殊的人他可以随意出什么手势,问是否能够从给出的一系列石头剪刀布游戏中判断出哪个是特殊的,可以从第几局游戏中判断出来. 首先按照食 ...