服务使用的是ScheduledThreadPoolExecuto定时任务,有使用到全局变量,数据库连接池使用的是c3p0,我感觉出现问题的原因可能就是这三个里哪个导致的,程序是没问题的,就是运行久了就出现各种问题了,而且很莫明奇妙,比如本来是好好的运行久了日志中的中文从那个时刻起往后全都乱码了。请问这是怎么回事?
定时任务:
ScheduledThreadPoolExecutor bookClickScheduled = new ScheduledThreadPoolExecutor(10);
int checkPHPConfigCycle = Integer.parseInt(Config.getConfig("CheckPHPConfigCycle"));
bookClickScheduled.scheduleWithFixedDelay(new CheckPhpConfigTask(), 0, checkPHPConfigCycle, TimeUnit.MINUTES);
连接池配置:
<property value="oracle.jdbc.driver.OracleDriver" name="driverClass"/>
<property value="jdbc:oracle:thin:@10.97.190.14:1521:cmfudv1" name="jdbcUrl"/>
<property value="" name="user"/>
<property value="" name="password"/>
<property value="1" name="minPoolSize"/>
<property value="2" name="maxPoolSize"/>
<property value="1" name="initialPoolSize"/>
<property value="60" name="maxIdleTime"/>
<property value="1" name="acquireIncrement"/>
<property value="0" name="maxStatements"/>
<property value="60" name="idleConnectionTestPeriod"/>
<property value="30" name="acquireRetryAttempts"/>
<property value="true" name="breakAfterAcquireFailure"/>
</bean>
看了一下日志,貌似是服务重启启动了
STATUS | wrapper | 2016/04/09 00:55:01 | TERM trapped. Shutting down.
STATUS | wrapper | 2016/04/09 00:55:02 | <-- Wrapper Stopped
STATUS | wrapper | 2016/04/09 00:55:02 | --> Wrapper Started as Daemon
STATUS | wrapper | 2016/04/09 00:55:02 | Java Service Wrapper Community Edition 64-bit 3.5.27
STATUS | wrapper | 2016/04/09 00:55:02 | Copyright (C) 1999-2015 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper | 2016/04/09 00:55:02 | http://wrapper.tanukisoftware.com
STATUS | wrapper | 2016/04/09 00:55:02 |
STATUS | wrapper | 2016/04/09 00:55:02 | Launching a JVM...
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager: Initializing...
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager:
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager: WARNING - Unable to load the Wrapper's native library because none of the
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager: following files:
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager: libwrapper-linux-x86-64.so
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager: libwrapper.so
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager: could be located on the following java.library.path:
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager: /usr/local/src/javaService/Baiduping2Service/bin/../lib
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager: Please see the documentation for the wrapper.java.library.path
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager: configuration property.
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager: System signals will not be handled correctly.
INFO | jvm 1 | 2016/04/09 00:55:02 | WrapperManager:
INFO | jvm 1 | 2016/04/09 00:55:03 | SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
INFO | jvm 1 | 2016/04/09 00:55:03 | SLF4J: Defaulting to no-operation (NOP) logger implementation
INFO | jvm 1 | 2016/04/09 00:55:03 | SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
INFO | jvm 1 | 2016/04/09 00:55:03 | INFO - Log4j - ????
INFO | jvm 1 | 2016/04/09 00:55:03 | INFO - MLog - MLog clients using log4j logging.
INFO | jvm 1 | 2016/04/09 00:55:03 | INFO - C3P0Registry - Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
INFO | jvm 1 | 2016/04/09 00:55:03 | INFO - stractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> true, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> z8kflt9f1wh77y1c9vh4r|38c52200, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> z8kflt9f1wh77y1c9vh4r|38c52200, idleConnectionTestPeriod -> 60, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@oracoredb2.qdintra.com:1521:cmfu, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 60, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 5, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
INFO | jvm 1 | 2016/04/09 00:55:04 | INFO - stractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> true, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> z8kflt9f1wh77y1c9vh4r|3ee7f6eb, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> z8kflt9f1wh77y1c9vh4r|3ee7f6eb, idleConnectionTestPeriod -> 60, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@orabooksyncdb.qdintra.com:1521:cmfu162, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 60, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 5, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
INFO | jvm 1 | 2016/04/09 00:57:12 | INFO - Log4j - bookID:3623267,res:true
INFO | jvm 1 | 2016/04/09 00:57:14 | INFO - Log4j - bookID:3564278,res:true
INFO | jvm 1 | 2016/04/09 00:57:18 | INFO - Log4j - bookID:3630677,res:true
STATUS | wrapper | 2016/04/09 01:30:01 | TERM trapped. Shutting down.
STATUS | wrapper | 2016/04/09 01:30:02 | <-- Wrapper Stopped
STATUS | wrapper | 2016/04/09 01:30:02 | --> Wrapper Started as Daemon
STATUS | wrapper | 2016/04/09 01:30:02 | Java Service Wrapper Community Edition 64-bit 3.5.27
STATUS | wrapper | 2016/04/09 01:30:02 | Copyright (C) 1999-2015 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper | 2016/04/09 01:30:02 | http://wrapper.tanukisoftware.com
STATUS | wrapper | 2016/04/09 01:30:02 |
STATUS | wrapper | 2016/04/09 01:30:02 | Launching a JVM...
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager: Initializing...
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager:
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager: WARNING - Unable to load the Wrapper's native library because none of the
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager: following files:
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager: libwrapper-linux-x86-64.so
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager: libwrapper.so
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager: could be located on the following java.library.path:
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager: /usr/local/src/javaService/Baiduping2Service/bin/../lib
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager: Please see the documentation for the wrapper.java.library.path
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager: configuration property.
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager: System signals will not be handled correctly.
INFO | jvm 1 | 2016/04/09 01:30:02 | WrapperManager:
INFO | jvm 1 | 2016/04/09 01:30:03 | SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
INFO | jvm 1 | 2016/04/09 01:30:03 | SLF4J: Defaulting to no-operation (NOP) logger implementation
INFO | jvm 1 | 2016/04/09 01:30:03 | SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
INFO | jvm 1 | 2016/04/09 01:30:03 | INFO - Log4j - ????
INFO | jvm 1 | 2016/04/09 01:30:03 | INFO - MLog - MLog clients using log4j logging.
INFO | jvm 1 | 2016/04/09 01:30:03 | INFO - C3P0Registry - Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
INFO | jvm 1 | 2016/04/09 01:30:03 | INFO - stractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> true, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> z8kflt9f1wig8b6168q1b9|ec0a9f9, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> z8kflt9f1wig8b6168q1b9|ec0a9f9, idleConnectionTestPeriod -> 60, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@oracoredb2.qdintra.com:1521:cmfu, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 60, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 5, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
INFO | jvm 1 | 2016/04/09 01:30:04 | INFO - stractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> true, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> z8kflt9f1wig8b6168q1b9|6708f8e0, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> z8kflt9f1wig8b6168q1b9|6708f8e0, idleConnectionTestPeriod -> 60, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@orabooksyncdb.qdintra.com:1521:cmfu162, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 60, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 5, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
INFO | jvm 1 | 2016/04/09 01:30:06 | INFO - Log4j - bookID:1659706,res:true
INFO | jvm 1 | 2016/04/09 01:30:06 | INFO - Log4j - bookID:3593166,res:true
STATUS | wrapper | 2016/04/09 02:05:01 | TERM trapped. Shutting down.
STATUS | wrapper | 2016/04/09 02:05:02 | <-- Wrapper Stopped
STATUS | wrapper | 2016/04/09 02:05:02 | --> Wrapper Started as Daemon
STATUS | wrapper | 2016/04/09 02:05:02 | Java Service Wrapper Community Edition 64-bit 3.5.27
STATUS | wrapper | 2016/04/09 02:05:02 | Copyright (C) 1999-2015 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper | 2016/04/09 02:05:02 | http://wrapper.tanukisoftware.com
STATUS | wrapper | 2016/04/09 02:05:02 |
STATUS | wrapper | 2016/04/09 02:05:02 | Launching a JVM...
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager: Initializing...
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager:
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager: WARNING - Unable to load the Wrapper's native library because none of the
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager: following files:
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager: libwrapper-linux-x86-64.so
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager: libwrapper.so
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager: could be located on the following java.library.path:
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager: /usr/local/src/javaService/Baiduping2Service/bin/../lib
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager: Please see the documentation for the wrapper.java.library.path
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager: configuration property.
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager: System signals will not be handled correctly.
INFO | jvm 1 | 2016/04/09 02:05:02 | WrapperManager:
INFO | jvm 1 | 2016/04/09 02:05:03 | SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
INFO | jvm 1 | 2016/04/09 02:05:03 | SLF4J: Defaulting to no-operation (NOP) logger implementation
INFO | jvm 1 | 2016/04/09 02:05:03 | SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
INFO | jvm 1 | 2016/04/09 02:05:03 | INFO - Log4j - ????
INFO | jvm 1 | 2016/04/09 02:05:03 | INFO - MLog - MLog clients using log4j logging.
INFO | jvm 1 | 2016/04/09 02:05:03 | INFO - C3P0Registry - Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
INFO | jvm 1 | 2016/04/09 02:05:04 | INFO - stractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> true, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> z8kflt9f1wjp8pwwokymc|38c52200, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> z8kflt9f1wjp8pwwokymc|38c52200, idleConnectionTestPeriod -> 60, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@oracoredb2.qdintra.com:1521:cmfu, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 60, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 5, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
INFO | jvm 1 | 2016/04/09 02:05:04 | INFO - stractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> true, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> z8kflt9f1wjp8pwwokymc|3ee7f6eb, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> z8kflt9f1wjp8pwwokymc|3ee7f6eb, idleConnectionTestPeriod -> 60, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@orabooksyncdb.qdintra.com:1521:cmfu162, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 60, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 5, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]