zoukankan      html  css  js  c++  java
  • springboot2.0集成shiro出现ShiroDialect报错找不到AbstractTextChildModifierAttrPr

       @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>
  • 相关阅读:
    [转]SP 2010: How To – Event Receivers and Custom Error Pages
    sharepoint ServerTemplate values
    SPSiteDataQuery不完全使用手册(转)
    jQuery EasyUI 提示框(Messager)用法
    单选按钮 点击value值自动把单选按钮选中
    easy ui tabs 顶部绑定事件
    jquery 中的 $("#id") 与 document.getElementById("id") 的区别
    jquery ajax 的data 存表单的值
    JSP中用include标签动态引入其它文件报错
    Js获取当前日期时间及其它操作
  • 原文地址:https://www.cnblogs.com/limn/p/9690265.html
Copyright © 2011-2022 走看看