开发者社区> 问答> 正文

druid配置问题sql监控没有信息 - druid报错

用是tomcat

数据源配置<Resource auth="Container" 
      name="jdbc/db2"
      factory="com.alibaba.druid.pool.DruidDataSourceFactory"
      type="javax.sql.DataSource"
      driverClassName="com.ibm.db2.jcc.DB2Driver"
      username="db2admin"
      password="look1983score"  
      maxWait="10000"  
      maxActive="100" 
      initialSize="2"
      filters="stat"
      removeAbandoned="true"
      removeAbandonedTimeout="1200"
      logAbandoned="true"
      url="jdbc:db2://localhost:50000/nbjsw" />

web.xml配置

<filter>
   <filter-name>DruidWebStatFilter</filter-name>
   <filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
   <init-param>
    <param-name>exclusions</param-name>
    <param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*</param-value>
   </init-param>
   <init-param>
             <param-name>profileEnable</param-name>
             <param-value>true</param-value>
         </init-param>
   <init-param>
    <param-name>sessionStatMaxCount</param-name>
    <param-value>1000</param-value>
   </init-param>
   <init-param>
    <param-name>principalSessionName</param-name>
    <param-value>xxx.user</param-value>
   </init-param>
  </filter>
  <filter-mapping>
   <filter-name>DruidWebStatFilter</filter-name>
   <url-pattern>/*</url-pattern>
  </filter-mapping>
<servlet>
     <servlet-name>DruidStatView</servlet-name>
     <servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>  
 </servlet>   
 <servlet-mapping>
     <servlet-name>DruidStatView</servlet-name>
     <url-pattern>/druid/*</url-pattern>
 </servlet-mapping>

监控页面没有sql信息如下图所示:

展开
收起
montos 2020-06-02 23:19:21 1253 0
1 条回答
写回答
取消 提交回答
  • 我也是出现这样的情况 ,大哥,怎么破

    2020-06-02 23:19:54
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
SQL Server 2017 立即下载
GeoMesa on Spark SQL 立即下载
原生SQL on Hadoop引擎- Apache HAWQ 2.x最新技术解密malili 立即下载