
spring:
datasource:
username: root
password: 123456
#假如时区报错了,就增加一个时区配置:serverTimezone=UTC
url: jdbc:mysql://localhost:3306/mybatisdb?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
driver-class-name: com.mysql.cj.jdbc.Driver
springboot整合Druid时出现的异常
由于 /** 与 /* 造成的异常
在基于springBoot框架整合Druid时,在DruidConfig配置类配置对应的ServletRegistrationBean时,路径不小心填写了/druid/**,导致了本地访问时,无法跳转DRUID的监控登陆页面而是报了404错误,当后来修改为/druid/*时,则可以正常访问login页面。
/druid/**时
ServletRegistrationBean bean = new ServletRegistrationBean(new StatViewServlet(), "/druid/**");
ServletRegistrationBean bean = new ServletRegistrationBean(new StatViewServlet(), "/druid/*");
/*与/**的区别:
/*是指代下面的一级路径 不包括其子目录下的资源 /**是指代的下面的全部路径 包括其子目录的下的资源。shiro框架 出现NoClassDefFoundError
出现这样的错误是因为pom.xml里缺少了一个依赖。
解决方法是添加
commons-logging commons-logging 1.2
修改后的pom.xml文件是
springboot-08-shiro com.zhu 1.0-SNAPSHOT 4.0.0 hello-shiro 8 8 org.apache.shiro shiro-core 1.4.1 org.slf4j slf4j-simple 1.7.21 test org.slf4j jcl-over-slf4j 1.7.21 test commons-logging commons-logging 1.2
修改过后重新启动,输出结果为;