Open x113773 opened 7 years ago
我也遇到了同样的问题
这个是bug?我以为是正常的。。。
应该没事,不影响使用。我看了下源码,那个DIV是写死的,一直存在的。
@x113773 @wlq1005 @wenshao 这不是BUG,因为Spring Boot在启动时并不会初始化数据源,在真正使用数据源的时候才会初始化它,可以通过日志来观察。
com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited
将@Bean更改为 @Bean(destroyMethod = "close", initMethod = "init") 就可以了
我以为是我的错,现在在springboot下是不是都用druid-spring-boot-starter了这种方式了?
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
SpringBoot 2.0.1.RELEASE 我也遇到这个问题了
1.1.10版本 增加了init 和close启动报错 去掉就正常...
如果配置了Spring Security。 需要让security的csrf校验忽略Druid的请求。
http.csrf().ignoringAntMatchers("/druid/**")
这个问题还有一种情况可能引起,就是检查是否设置了Content-Security-Policy响应头,这个响应头可以在应用内或者nginx等地方配置。druid监控页面中DataSourceStat List页需要放开script-src 'unsafe-inline' 'unsafe-eval'安全策略。
启动项目直接访问数据源页面是这样的,只显示(*) property for user to setup: 执行一个sql语句后,再查看数据源页面就正常了
第一次用druid,这样是正常的吗?