alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.9k stars 8.57k forks source link

数据源页面:(*) property for user to setup #1802

Open x113773 opened 7 years ago

x113773 commented 7 years ago

启动项目直接访问数据源页面是这样的,只显示(*) property for user to setup: qq 20170629102037 执行一个sql语句后,再查看数据源页面就正常了 qq 20170629093548

第一次用druid,这样是正常的吗?

wlq1005 commented 7 years ago

我也遇到了同样的问题

qq592304796 commented 7 years ago

这个是bug?我以为是正常的。。。

lihengming commented 7 years ago

应该没事,不影响使用。我看了下源码,那个DIV是写死的,一直存在的。

lihengming commented 7 years ago

@x113773 @wlq1005 @wenshao 这不是BUG,因为Spring Boot在启动时并不会初始化数据源,在真正使用数据源的时候才会初始化它,可以通过日志来观察。

com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited
xiaozhaoosc commented 7 years ago

将@Bean更改为 @Bean(destroyMethod = "close", initMethod = "init") 就可以了

beinimaliesi commented 6 years ago

我以为是我的错,现在在springboot下是不是都用druid-spring-boot-starter了这种方式了?

songlongkuan commented 5 years ago
    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid-spring-boot-starter</artifactId>
        <version>1.1.10</version>
    </dependency>

SpringBoot 2.0.1.RELEASE 我也遇到这个问题了

diaodiaofly commented 5 years ago

8888 1.1.10版本 增加了init 和close启动报错 去掉就正常...

BiuBangBoom commented 5 years ago

如果配置了Spring Security。 需要让security的csrf校验忽略Druid的请求。

http.csrf().ignoringAntMatchers("/druid/**")

asker124143222 commented 3 years ago

这个问题还有一种情况可能引起,就是检查是否设置了Content-Security-Policy响应头,这个响应头可以在应用内或者nginx等地方配置。druid监控页面中DataSourceStat List页需要放开script-src 'unsafe-inline' 'unsafe-eval'安全策略。