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,地址栏也会发生变化,后者不会!
  • 相关阅读:
    剑指offer(45)扑克牌顺子
    剑指offer(44)单词翻转序列
    剑指offer(43)左旋转字符串
    剑指offer(42)和为S的字符串
    剑指offer(41)和为S的连续正数序列
    剑指offer(40)数组中只出现一次的数字
    剑指offer(39)平衡二叉树
    面试金典——字符串压缩
    LeetCode——恢复二叉搜索树
    LeetCode——修剪二叉搜索树
  • 原文地址:https://www.cnblogs.com/jpfss/p/8336091.html
Copyright © 2011-2022 走看看