zoukankan      html  css  js  c++  java
  • SpringBoot错误信息总结(不定时更新)

    1、“ java.lang.IllegalStateException: @Bean method ShiroConfig.cacheManager called as a bean reference for type [org.apache.shiro.cache.ehcache.EhCacheManager] but overridden by non-compatible bean instance of type [org.springframework.cache.support.NoOpCacheManager]. Overriding bean of same name declared in: class path resource [org/springframework/boot/autoconfigure/cache/NoOpCacheConfiguration.class]”
    解决方案:下面两个jar冲突了,删除springboot-cache即可:
    ```xml

    org.springframework.boot
    spring-boot-starter-cache

    org.apache.shiro
    shiro-ehcache
    ${shiro.version}

    2、其实SpringBoot可以自带同时读取yml和propertites文件属性的类“org.springframework.boot.bind.RelaxedPropertyResolver;”通过该类的“getProperty()”方法既可以读取yml配置文件的属性,包括自定义属性也可以读取properties格式文件的自定义属性,网上的教程都不明说这一点,自己亲自实践是可以的。其实,我感觉SpringBoot的yml和properties文件格式可以通用的,没有问题,网上的教程都不完整,比如yml格式文件也可以用多个文件配置多环境等,自己实践总结出来,Mark一下!
    3、“return "redirect:/admin/login"”和“return "/admin/login"”由于前者会重定向跳转的是控制器,后者是找视图,会找对应目录下的视图文件,不用跳转控制器!另外,前者重定向之后是会产生新的session,地址栏也会发生变化,后者不会!
  • 相关阅读:
    SRCNN
    java(1)
    装机、UEFI双系统安装
    iOS-技术细节整理
    iOS-Hello World
    iOS-初识swift
    21天学习caffe(二)
    21天学习caffe(一)
    深度学习(一)
    Mysql 5.7 windows安装 zip安装
  • 原文地址:https://www.cnblogs.com/jpfss/p/8336091.html
Copyright © 2011-2022 走看看