springboot2.0集成shiro出现shirodialect报错找不到abstracttextchildmodifierattrpr

Kmily_Lee      2022-04-13     534

关键词:

 

   @Bean
    public ShiroDialect shiroDialect() {
        return new ShiroDialect();
    }

报错出现找不到org/thymeleaf/processor/attr/AbstractTextChildModifierAttrProcessor

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘shiroDialect‘ defined in class path resource [com/zhicaili/springbootshiro/config/ShiroConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [at.pollux.thymeleaf.shiro.dialect.ShiroDialect]: Factory method ‘shiroDialect‘ threw exception; nested exception is java.lang.NoClassDefFoundError: org/thymeleaf/processor/attr/AbstractTextChildModifierAttrProcessor
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:590) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1247) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1096) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:333) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1277) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1265) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
    at com.zhicaili.springbootshiro.SpringbootShiro01Application.main(SpringbootShiro01Application.java:15) [classes/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [at.pollux.thymeleaf.shiro.dialect.ShiroDialect]: Factory method ‘shiroDialect‘ threw exception; nested exception is java.lang.NoClassDefFoundError: org/thymeleaf/processor/attr/AbstractTextChildModifierAttrProcessor
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:582) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE]
    ... 18 common frames omitted

再来查看下thymeleaf-extras-shiro 的版本,真的是版本的问题

一开始的版本

        <dependency>
            <groupId>com.github.theborakompanioni</groupId>
            <artifactId>thymeleaf-extras-shiro</artifactId>
            <version>1.2.1</version>
        </dependency>

修改成2.0.0就没问题了

修改后

        <dependency>
            <groupId>com.github.theborakompanioni</groupId>
            <artifactId>thymeleaf-extras-shiro</artifactId>
            <version>2.0.0</version>
        </dependency>

 

springboot2+shiro实现权限管理

...会话管理。看了网上一些文章,下面2篇文章写得不错。Springboot2.0集成shiro权限管理 SpringBoot:整合Shiro权限框架 自己动手敲了下代码,在第一篇文章上加入了第二篇文章的Swagger测试,另外自己加入lombok简化实体类代码,... 查看详情

springboot2.0+shiro+jwt整合(代码片段)

SpringBoot2.0+Shiro+JWT整合JSONWebToken(JWT)是一个非常轻巧的规范。这个规范允许我们使用JWT在用户和服务器之间传递安全可靠的信息。我们利用一定的编码生成Token,并在Token中加入一些非敏感信息,将其传递。安装环境开发工具:... 查看详情

springboot2.0集成fastdfs

SpringBoot2.0集成FastDFS前两篇整体上介绍了通过Nginx和FastDFS的整合来实现文件服务器。但是,在实际开发中对图片或文件的操作都是通过应用程序来完成的,因此,本篇将介绍SpringBoot整合FastDFS客户端来实现对图片/文件服务器的访... 查看详情

activity6.0集成springboot2.0

1、添加依赖<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM 查看详情

springboot2.0-集成redis

序最近在入门SpringBoot,然后在感慨SpringBoot较于Spring真的方便多时,顺便记录下自己在集成redis时的一些想法。1、从springboot官网查看redis的依赖包<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-st 查看详情

springboot2.0图文教程|集成邮件发送功能

...springboot/spring-boots-send-mail大家好,后续会间断地奉上一些SpringBoot2.x相关的博文,包括SpringBoot2.x教程和SpringBoot2.x新特性教程相关,如WebFlux等。还有自定义Starter组件的进阶教程,比如:如何封装一个自定义图 查看详情

springboot2.0实战(23)整合redis之集成缓存springdatacache

SpringBoot2.0实战(23)整合Redis之集成缓存SpringDataCache来源:https://www.toutiao.com/a6803168397090619908/?timestamp=1584450221&app=news_article_lite&group_id=6803168397090619908&req_id=20200317210341 查看详情

springboot2.0:springboot集成memcached

Memcached介绍Memcached是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载。它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态、数据库驱动网站的速度。Memcached基于一个存储键/值对... 查看详情

springboot2.0集成elk7.6.2(代码片段)

小伙伴们,你们好,我是老寇注:请点击我,获取源码mysql安装包链接:https://pan.baidu.com/s/1swrV9ffJnmz4S0mfkuBbIw 提取码:1111目录一、前提条件二、集成过程一、前提条件1.es7.6.2集群2.安装kibana7.6.2logstash7.6.2二... 查看详情

springboot2.0:重磅springboot2.0权威发布

就在昨天SpringBoot2.0.0.RELEASE正式发布,今天早上在发布SpringBoot2.0的时候还出现一个小插曲,将SpringBoot2.0同步到Maven仓库的时候出现了错误,然后SpringBoot官方又赶紧把GitHub上发布的v2.0.0.RELEASE版本进行了撤回。到了下午将问题修复... 查看详情

springboot2.0整合mybatisshiroredis实现基于数据库权限管理系统

转自https://blog.csdn.net/poorcoder_/article/details/71374002本文主要介绍使用SpringBoot与shiro实现基于数据库的细粒度动态权限管理系统实例。使用技术:SpringBoot、mybatis、shiro、thymeleaf、pagehelper、Mapper插件、druid、dataTables、ztree、jQuery开发... 查看详情

springboot2.0基础案例(08):集成redis数据库,实现缓存管理(代码片段)

...MongoDB,Elasticsearch。这些案例整理好后,陆续都会上传Git。SpringBoot2版本,支持的组件越来越丰富,对Redis的支持不仅仅是扩展了API,更是替换掉底层Jedis的依赖,换成Lettuce。本案例需要本地 查看详情

springboot2.0集成kafka2.6.2(集群)+elk7.6.2(集群)

小伙伴们,你们好,我是老寇目录一、前提条件二、准备工作三、ELK介绍四、Kafka介绍五、日志监控架构图六、微服务集成一、前提条件搭建kafka集群搭建elasticsearch集群搭建微服务环境二、准备工作192.168.1.1(启动Elast... 查看详情

springboot2.0集成elasticsearch7.6.2(集群)关键字高亮显示

小伙伴们,你们好呀,我是老寇,跟我一起学习es7.6.2注:请点击我,获取源码视频地址老寇-es通过关键字高亮显示一、搜索入门1.无条件搜索命令GET/index/_searchGET/message/_search2.传参搜索命令GET/index/_search?q=fil... 查看详情

springboot2.0.4整合mybatis出现异常property'sqlsessionfactory'or'sqlsessiontemplate'a

在使用Springboot2.0.4整合Mybatis的时候出现异常Property‘sqlSessionFactory‘or‘sqlSessionTemplate‘arerequired,然后各种找日志百度,网上给了一种解决方法:版本太高,使用手动注入sqlSessionFactory,然后用dao的实习类继承,因为我的项目没... 查看详情

shiro学习——shiro与web集成(代码片段)

...架,最主要的服务对象应该就是JavaWeb。因此如何与web集成是发挥shiro作用的关键。这里以最基础的与servlet集成作为例子。新建简单的servlet应用这里以《Eclipse新建基于Servlet3.x的maven项目》这篇文章的方式构建基本的servlet࿰... 查看详情

shiro学习——shiro与web集成(代码片段)

...架,最主要的服务对象应该就是JavaWeb。因此如何与web集成是发挥shiro作用的关键。这里以最基础的与servlet集成作为例子。新建简单的servlet应用这里以《Eclipse新建基于Servlet3.x的maven项目》这篇文章的方式构建基本的servlet࿰... 查看详情

springboot2.0整合fastjson的正确姿势(代码片段)

    SpringBoot2.0如何集成fastjson?在网上查了一堆资料,但是各文章的说法不一,有些还是错的,可能只是简单测试一下就认为ok了,最后有没生效都不知道。恰逢公司项目需要将JackSon换成fastjson,因此自己来实践一... 查看详情