Git Product home page Git Product logo

Comments (2)

gwsh1234 avatar gwsh1234 commented on May 25, 2024

@billho 与您遇到了相似的问题。但是我的提示是
2019-03-15 13:49:48.030 ERROR [cloud-zuul,,,] 5676 --- [ost-startStop-1] o.s.b.c.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'shiroFilter': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException: chainDefinition cannot be null or empty.

ShiroService.java中片段代码

List<PermissionRole> roles = userDao.getAllRolesByPermission(); for (PermissionRole role : roles){ filterRuleMap.put(role.getPermissionUrl(),role.getRoleName()); }

我是把PostgreSQL 直接改成了MySQL 其中有一个String_agg聚合函数直接让我改成了group_concat,可能是因为这个的原因导致查询 Shiro中要过滤的路径和权限中RoleName中就有NULL值。我将上述代码修改成

List<PermissionRole> roles = userDao.getAllRolesByPermission(); for (PermissionRole role : roles){ if (role.getRoleName() != null && role.getPermissionUrl() != null) { filterRuleMap.put(role.getPermissionUrl(),role.getRoleName()); } }

就不会出现
nested exception is java.lang.NullPointerException: chainDefinition cannot be null or empty.

的错误。或许不是最佳的解决办法,希望可以提供给您一点思路

from spring-cloud-cli.

xuyaohui avatar xuyaohui commented on May 25, 2024

更改后的版本已解决这个问题,最新版将数据源修改为mysql,并修改聚合函数

from spring-cloud-cli.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.