[Tomcat boot error]registered the JDBC driver [Com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web appl Ication was stopped

Source: Internet
Author: User

Environment: A tomcat, a project configured with multiple data sources, the following error is reported at startup:

Severe:the Web Application [/qdp-resource-Job] registered the JDBC driver [Com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the Web application Was stopped. To prevent a memory leak, the JDBC Driver have been forcibly unregistered.  the3:23:27 PM org.apache.catalina.loader.WebappClassLoader clearreferencesjdbcsevere:the Web application [/ Qdp-resource-job] registered the JDBC driver [Com.mysql.jdbc.Driver] but failed to unregister it when the Web application Was stopped. To prevent a memory leak, the JDBC Driver have been forcibly unregistered. 3:23:27 PM org.apache.catalina.loader.WebappClassLoader clearreferencesthreadssevere:the Web Application [ /qdp-resource-job] appears to had started a thread named [Abandoned connection cleanup thread] but had failed to stop it. This was very likely to create a memory leak. the -, . 3: at: -PM org.apache.catalina.loader.WebappClassLoader clearreferencesthreadssevere:the Web application [/qdp-resource-job] appears to has started a thread named [druid-connectionpool-create-827239851] but had failed to stop it. This was very likely to create a memory leak. the -, . 3: at: -PM org.apache.catalina.loader.WebappClassLoader clearreferencesthreadssevere:the Web application [/qdp-resource-job] appears to has started a thread named [druid-connectionpool-destroy-827239851] but had failed to stop it. This was very likely to create a memory leak. the -, . 3: at: -PM org.apache.catalina.loader.WebappClassLoader clearreferencesthreadssevere:the Web application [/qdp-resource-job] appears to has started a thread named [druid-connectionpool-create-913636676] but had failed to stop it. This was very likely to create a memory leak. the -, . 3: at: -PM org.apache.catalina.loader.WebappClassLoader clearreferencesthreadssevere:the Web application [/qdp-resource-job] appears to has started a thread named [druid-connectionpool-destroy-913636676] but had failed to stop it. This was very likely to create a memory leak. the -, . 3: at: -PM org.apache.catalina.loader.WebappClassLoader clearreferencesthreadssevere:the Web application [/qdp-resource-job] appears to has started a thread named [druid-connectionpool-create-789799328] but had failed to stop it. This was very likely to create a memory leak. the -, . 3: at: -PM org.apache.catalina.loader.WebappClassLoader clearreferencesthreadssevere:the Web application [/qdp-resource-job] appears to has started a thread named [druid-connectionpool-destroy-789799328] but had failed to stop it. This was very likely to create a memory leak. the -, . 3: at: -PM org.apache.catalina.loader.WebappClassLoader clearreferencesthreadssevere:the Web application [/qdp-resource-job] appears to has started a thread named [druid-connectionpool-create-927599675] but had failed to stop it. This was very likely to create a memory leak.

WORKAROUND: When configuring multiple data sources, configure only one to initialize at startup, and the other to be fixed, as follows:

<!--First Data source -    <Beanname= "Datasourceresource"class= "Com.alibaba.druid.pool.DruidDataSource"Init-method= "Init"Destroy-method= "Close">        < Propertyname= "url"value= "${jdbc.url}" />         < Propertyname= "username"value= "${jdbc.username}" />         < Propertyname= "Password"value= "${jdbc.password}" />         < Propertyname= "InitialSize"value= "${jdbc.initialsize}" />         < Propertyname= "Minidle"value= "${jdbc.minidle}" />         < Propertyname= "Maxactive"value= "${jdbc.maxactive}" />         < Propertyname= "Maxwait"value= "${jdbc.maxwait}" />         < Propertyname= "Timebetweenevictionrunsmillis"value= "${jdbc.timebetweenevictionrunsmillis}" />         < Propertyname= "Minevictableidletimemillis"value= "${jdbc.minevictableidletimemillis}" />         < Propertyname= "Validationquery"value= "${jdbc.validationquery}" />        < Propertyname= "Testwhileidle"value= "${jdbc.testwhileidle}" />         < Propertyname= "Testonborrow"value= "${jdbc.testonborrow}" />         < Propertyname= "Testonreturn"value= "${jdbc.testonreturn}" />         < Propertyname= "removeabandoned"value= "${jdbc.removeabandoned}" />         < Propertyname= "Removeabandonedtimeout"value= "${jdbc.removeabandonedtimeout}" />         < Propertyname= "Filters"value= "${jdbc.filters}" />        < Propertyname= "logabandoned"value= "true" />        < Propertyname= "Proxyfilters">            <List>                <refBean= "Log-filter"/>            </List>        </ Property>    </Bean>    <!--Second Data source -    <Beanname= "Datasourcecustomer"class= "Com.alibaba.druid.pool.DruidDataSource"Init-method= "Init"Destroy-method= "Close">        < Propertyname= "url"value= "${customer.url}" />         < Propertyname= "username"value= "${customer.username}" />         < Propertyname= "Password"value= "${customer.password}" />     </Bean>        <!--Third Data source -    <Beanname= "Datasourcebuilding"class= "Com.alibaba.druid.pool.DruidDataSource"Init-method= "Init"Destroy-method= "Close">        < Propertyname= "url"value= "${building.url}" />         < Propertyname= "username"value= "${building.username}" />         < Propertyname= "Password"value= "${building.password}" />     </Bean>

The second and third data sources retain only the most basic URL, username, password three configurations!

[Tomcat boot error]registered the JDBC driver [Com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web appl Ication was stopped

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.