{message:parsed configuration file: ' Class path resource [Mybatisconfig.xml] '} Startup card dead

Source: Internet
Author: User
Tags connection reset time in milliseconds

Problem Description:

Restart a project that has been running for a long time, and when the following progress is made, the startup card dies without throwing any exceptions:

2014-05-07 10:45:23 [DEBUG] [ Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:504)]--{message:eagerly caching bean ' Org.springframework.transaction.annotation.annotationtransactionattributesource#0 ' to allow for resolving potential Circular references} 2014-05-07 10:45:23 [DEBUG] [ Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:458)]--{message:finished Creating instance of Bean ' Org.springframework.transaction.annotation.annotationtransactionattributesource#0 '} 2014-05-07 10:45:23 [DEBUG] [ Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:458)]--{message:finished Creating instance of Bean ' Org.springframework.transaction.config.internalTransactionAdvisor '} 2014-05-07 10:45:23 [DEBUG] [ Org.springframework.beans.factory.support.AbstractAutowireCapAblebeanfactory.createbean (abstractautowirecapablebeanfactory.java:458)]--{message:finished Creating instance of Bean ' DataSource '} 2014-05-07 10:45:23 [DEBUG] [ Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1498)]--{message:invoking afterpropertiesset () on beans with name ' Sqlsessionfactory '} 2014-05-07 10:45:23 [DEBUG] [Org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug (jakartacommonsloggingimpl.java:46)] --{message:parsed configuration file: ' Class path resource [Mybatisconfig.xml] '} 2014-05-07 11:32:02 [DEBUG] [Org.apache . Ibatis.logging.commons.JakartaCommonsLoggingImpl.debug (JAKARTACOMMONSLOGGINGIMPL.JAVA:46)]--{Message:property ' Mapperlocations ' is not specified or no matching resources found} 2014-05-07 11:32:02 [DEBUG] [Org.springframework.beans . Factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:245)]--{message:returning Cached Instance of Singleton Bean ' org.springframework.transaction.config.internalTransactionAdvisor '} 2014-05-07 11:32:02 [DEBUG] [ Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:458)]--{message:finished Creating instance of Bean ' sqlsessionfactory '}

From the log can be seen, until 11:32, that is, after 47 minutes, before continuing to start.


Reason Analysis:

Spring loads the Mybatiscofig.xml to consider whether the database connectivity issue is the same as the query configuration information:

initialsize=10
maxactive=20
maxwait=60000

1. Consider connecting the number of database connections, after checking, the number of database connections is 300, has been used only more than 100

2. Consider the connection waiting time problem, the maxwait time to 6000, that is 6s, after the start of the same card dead

3, query DBCP connection configuration, add the following configuration, print DBCP connection log:

<!--removeabandoned: Automatically recycle timeout connection--> 
<property name= "removeabandoned" value= "true"/> 
<!-- Removeabandonedtimeout: Timeout time (in seconds)--> 
<property name= "removeabandonedtimeout" value= " 
180"/> <!--maxwait: Timeout wait time in milliseconds 6000 milliseconds/1000 equals 60 seconds--> 

The corresponding configuration changes are made in spring.

Start at this time and find that startup is no longer jammed and will soon start up and throw an exception.

2014-05-07 11:59:18 [DEBUG] [ Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1498)]--{message:invoking afterpropertiesset () on beans with name ' Sqlsessionfactory '} 2014-05-07 11:59:19 [DEBUG] [Org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug (jakartacommonsloggingimpl.java:46)] --{message:parsed configuration file: ' Class path resource [Mybatisconfig.xml] '} Abandonedobjectpool is used (Org.apache . commons.dbcp.abandonedobjectpool@2cea3932) Logabandoned:true removeabandoned:true removeabandonedtimeout:10 2 014-05-07 12:00:25 [ERROR] [Org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.error (
JAKARTACOMMONSLOGGINGIMPL.JAVA:38)]--{message:could not get a databaseId from DataSource} Org.apache.commons.dbcp.SQLNestedException:Cannot Create Poolableconnectionfactory (Io exception: Connection reset) at O Rg.apache.commons.dbcp.BasicDataSource.createDataSource (Basicdatasource.java:1244) at Org.apache.commons.dbcp.BasicDataSource.getConnection (basicdatasource.java:882) at org . Apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseProductName (vendordatabaseidprovider.java:76) at Org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseName (vendordatabaseidprovider.java:61) at Org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseId (vendordatabaseidprovider.java:49) at Org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory (sqlsessionfactorybean.java:445) at Org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet (sqlsessionfactorybean.java:336) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1514) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1452)

 At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:39) at Sun.reflect.DelegatingMethodA
        Ccessorimpl.invoke (delegatingmethodaccessorimpl.java:25) at Java.lang.reflect.Method.invoke (method.java:597) At Org.apache.catalina.startup.Bootstrap.start (bootstrap.java:289) at Org.apache.catalina.startup.Bootstrap.mai N (bootstrap.java:414) caused By:java.sql.SQLException:Io exception: Connection Reset at Oracle.jdbc.driver.DatabaseErro R.throwsqlexception (databaseerror.java:111) at Oracle.jdbc.driver.DatabaseError.throwSqlException ( databaseerror.java:145) at Oracle.jdbc.driver.DatabaseError.throwSqlException (databaseerror.java:254) at O Racle.jdbc.driver.T4CConnection.logon (t4cconnection.java:386) at oracle.jdbc.driver.physicalconnection.<init&
        gt; (physicalconnection.java:413) at oracle.jdbc.driver.t4cconnection.<init> (t4cconnection.java:164) At ORACLE.JDBC.DRIVER.T4CDRIVEREXTENSION.GEtconnection (t4cdriverextension.java:34) at Oracle.jdbc.driver.OracleDriver.connect (oracledriver.java:752) At Org.apache.commons.dbcp.DriverConnectionFactory.createConnection (driverconnectionfactory.java:38) at Org.apach E.commons.dbcp.poolableconnectionfactory.makeobject (poolableconnectionfactory.java:294) at Org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory (basicdatasource.java:1266) at Org.apache.commons.dbcp.BasicDataSource.createDataSource (basicdatasource.java:1240) ... More

Prove that there is a problem with the database itself, and eventually restart Oracle to solve the problem.





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.