[2013-12-06 11:06:21,715] [C3P0PooledConnectionPoolManager[identityToken->2tl0n98y1iwg7cbdzzq7a|719f1f]-HelperThread-#2] DEBUG - com.mchange.v2.c3p0.impl.NewPooledConnection@484c6b closed by a client.
java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE
    at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:646)
    at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:259)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:619)
    at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1024)
    at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648)
[2013-12-06 11:06:21,716] [C3P0PooledConnectionPoolManager[identityToken->2tl0n98y1iwg7cbdzzq7a|719f1f]-HelperThread-#2] DEBUG - Successfully destroyed PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@484c6b

经过分析源码,得到的结论是这个异常可以无视掉。
相关源码如下(c3p0版本:c3p0-0.9.2.1):
package com.mchange.v2.c3p0.impl;

import java.util.*;
import java.sql.*;
import javax.sql.*;
import com.mchange.v2.c3p0.*;
import com.mchange.v2.c3p0.stmt.*;
import com.mchange.v2.c3p0.util.*;
import com.mchange.v2.log.*; import java.lang.reflect.Method;
import com.mchange.v2.lang.ObjectUtils;
import com.mchange.v2.sql.SqlUtils; public final class NewPooledConnection extends AbstractC3P0PooledConnection{ private final static MLogger logger = MLog.getLogger( NewPooledConnection.class );

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

//  methods below must be called from sync'ed methods

    /*
* If a throwable cause is provided, the PooledConnection is known to be broken (cause is an invalidating exception)
* and this method will not throw any exceptions, even if some resource closes fail.
*
* If cause is null, then we think the PooledConnection is healthy, and we will report (throw) an exception
* if resources unexpectedlay fail to close.
*/
private void close( Throwable cause ) throws SQLException
{ close( cause, false ); } private void close( Throwable cause, boolean forced ) throws SQLException
{
assert Thread.holdsLock( this ); if ( this.invalidatingException == null )
{
List closeExceptions = new LinkedList(); // cleanup ResultSets
cleanupResultSets( closeExceptions ); // cleanup uncached Statements
// System.err.println(this + ".close( ... ) -- uncachedActiveStatements: " + uncachedActiveStatements);
cleanupUncachedStatements( closeExceptions ); // cleanup cached Statements
try
{ closeAllCachedStatements(); }
catch ( SQLException e )
{ closeExceptions.add(e); } if ( forced )
{
// reset transaction state
try { C3P0ImplUtils.resetTxnState( physicalConnection, forceIgnoreUnresolvedTransactions, autoCommitOnClose, false ); }
catch (Exception e)
{
if (logger.isLoggable( MLevel.FINER ))
logger.log( MLevel.FINER,
"Failed to reset the transaction state of " + physicalConnection + "just prior to close(). " +
"Only relevant at all if this was a Connection being forced close()ed midtransaction.",
e );
}
} // cleanup physicalConnection
try
{ physicalConnection.close(); }
catch ( SQLException e )
{
if (logger.isLoggable( MLevel.FINER ))
logger.log( MLevel.FINER, "Failed to close physical Connection: " + physicalConnection, e ); closeExceptions.add(e);
} // update our state to bad status and closed, and log any exceptions
if ( connection_status == ConnectionTester.CONNECTION_IS_OKAY )
connection_status = ConnectionTester.CONNECTION_IS_INVALID;
if ( cause == null )
{
this.invalidatingException = NORMAL_CLOSE_PLACEHOLDER; if ( Debug.DEBUG && logger.isLoggable( MLevel.FINEST ) )
logger.log( MLevel.FINEST, this + " closed by a client.", new Exception("DEBUG -- CLOSE BY CLIENT STACK TRACE") );//num:646 in the NewPooledConnection.java
/* Note that:
1、This is not an exception, the new Exception is used merely to show execution path for debug purposes.
2、And yes, this is only a debug message (actually, FINEST is the lowest possible level in java.util.logging).
To wrap this up: ignore and tune your logging levels to skip these. http://stackoverflow.com/questions/8403227/weird-error-close-by-client-stack-trace 既然成功了,干嘛还要丢异常出来? 这里就不得不说到两个商业开发的原则问题了。
第一,对上家传入数据严加过滤,对传出给下家的数据仔细检查。
第二,合理使用异常。
第一点其实很简单的。也就是模块化开发的一个思想问题。对自己的行为负责。前端返回的数据究竟是什么,需要进行校验。不合格的剔除或者是修正。合格的处理完后,在传出之前也要加以校验,是否合格 结合到 “合理使用异常” 这句话来说呢,就是说,需要抛出异常的时候,就抛出。不需要抛出的时候,就不抛出。对程序员来说,在必要的时候看到一串异常信息,是最合适的事情了。 http://www.zhixing123.cn/jsp/23305.html   */
                 logCloseExceptions( null, closeExceptions );

                if (closeExceptions.size() > 0)
throw new SQLException("Some resources failed to close properly while closing " + this);
}
else
{
this.invalidatingException = cause;
if (Debug.TRACE >= Debug.TRACE_MED)
logCloseExceptions( cause, closeExceptions );
else
logCloseExceptions( cause, null );
}
}
}
 
相关类:
/********************************************************************
* This class generated by com.mchange.v2.debug.DebugGen
* and will probably be overwritten by the same! Edit at
* YOUR PERIL!!! Hahahahaha.
********************************************************************/ package com.mchange.v2.c3p0.impl; import com.mchange.v2.debug.DebugConstants; final class Debug implements DebugConstants
{
final static boolean DEBUG = true;
final static int TRACE = TRACE_MAX; private Debug()
{}
}

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

 
package com.mchange.v2.log;

import java.util.*;

public final class MLevel
{
public final static MLevel ALL;
public final static MLevel CONFIG;
public final static MLevel FINE;
public final static MLevel FINER;
public final static MLevel FINEST;
public final static MLevel INFO;
public final static MLevel OFF;
public final static MLevel SEVERE;
public final static MLevel WARNING; private final static Map integersToMLevels;
private final static Map namesToMLevels; public static MLevel fromIntValue(int intval)
{ return (MLevel) integersToMLevels.get( new Integer( intval ) ); } public static MLevel fromSeverity(String name)
{ return (MLevel) namesToMLevels.get( name ); } static
{
Class lvlClass;
boolean jdk14api; //not just jdk14 -- it is possible for the api to be present with older vms
try
{
lvlClass = Class.forName( "java.util.logging.Level" );
jdk14api = true;
}
catch (ClassNotFoundException e )
{
lvlClass = null;
jdk14api = false;
} MLevel all;
MLevel config;
MLevel fine;
MLevel finer;
MLevel finest;
MLevel info;
MLevel off;
MLevel severe;
MLevel warning; try
{
// numeric values match the intvalues from java.util.logging.Level
all = new MLevel( (jdk14api ? lvlClass.getField("ALL").get(null) : null), Integer.MIN_VALUE, "ALL" );
config = new MLevel( (jdk14api ? lvlClass.getField("CONFIG").get(null) : null), 700, "CONFIG" );
fine = new MLevel( (jdk14api ? lvlClass.getField("FINE").get(null) : null), 500, "FINE" );
finer = new MLevel( (jdk14api ? lvlClass.getField("FINER").get(null) : null), 400, "FINER" );
finest = new MLevel( (jdk14api ? lvlClass.getField("FINEST").get(null) : null), 300, "FINEST" );
info = new MLevel( (jdk14api ? lvlClass.getField("INFO").get(null) : null), 800, "INFO" );
off = new MLevel( (jdk14api ? lvlClass.getField("OFF").get(null) : null), Integer.MAX_VALUE, "OFF" );
severe = new MLevel( (jdk14api ? lvlClass.getField("SEVERE").get(null) : null), 900, "SEVERE" );
warning = new MLevel( (jdk14api ? lvlClass.getField("WARNING").get(null) : null), 1000, "WARNING" );
}
catch ( Exception e )
{
e.printStackTrace();
throw new InternalError("Huh? java.util.logging.Level is here, but not its expected public fields?");
} ALL = all;
CONFIG = config;
FINE = fine;
FINER = finer;
FINEST = finest;
INFO = info;
OFF = off;
SEVERE = severe;
WARNING = warning; Map tmp = new HashMap();
tmp.put( new Integer(all.intValue()), all);
tmp.put( new Integer(config.intValue()), config);
tmp.put( new Integer(fine.intValue()), fine);
tmp.put( new Integer(finer.intValue()), finer);
tmp.put( new Integer(finest.intValue()), finest);
tmp.put( new Integer(info.intValue()), info);
tmp.put( new Integer(off.intValue()), off);
tmp.put( new Integer(severe.intValue()), severe);
tmp.put( new Integer(warning.intValue()), warning); integersToMLevels = Collections.unmodifiableMap( tmp ); tmp = new HashMap();
tmp.put( all.getSeverity(), all);
tmp.put( config.getSeverity(), config);
tmp.put( fine.getSeverity(), fine);
tmp.put( finer.getSeverity(), finer);
tmp.put( finest.getSeverity(), finest);
tmp.put( info.getSeverity(), info);
tmp.put( off.getSeverity(), off);
tmp.put( severe.getSeverity(), severe);
tmp.put( warning.getSeverity(), warning); namesToMLevels = Collections.unmodifiableMap( tmp );
} Object level;
int intval;
String lvlstring; public int intValue()
{ return intval; } public Object asJdk14Level()
{ return level; } public String getSeverity()
{ return lvlstring; } public String toString()
{ return this.getClass().getName() + this.getLineHeader(); } public String getLineHeader()
{ return "[" + lvlstring + ']';} public boolean isLoggable( MLevel filterLevel )
{ return this.intval >= filterLevel.intval; }
private MLevel(Object level, int intval, String lvlstring)
{
this.level = level;
this.intval = intval;
this.lvlstring = lvlstring;
}
}

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

 

 

package java.util.logging;

import java.util.*;
import java.security.*;
import java.lang.ref.WeakReference;

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

 
private static final int offValue = Level.OFF.intValue();
    private volatile int levelValue;  // current effective level value
    /** * Check if a message of the given level would actually be logged
* by this logger. This check is based on the Loggers effective level,
* which may be inherited from its parent. *
* @param level a message logging level
* @return true if the given message level is currently being logged. */
public boolean isLoggable(Level level) {
if (level.intValue() < levelValue || levelValue == offValue) {
return false; } return true; }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE 的理解的更多相关文章

  1. DEBUG -- CLOSE BY CLIENT STACK TRACE问题的两种解决方案,整理自网络

    1.DEBUG -- CLOSE BY CLIENT STACK TRACE 最近用c3p0遇到各种奇怪的问题,也不知道是它不行还是我不行. 今天又遇到了一个"DEBUG -- CLOSE ...

  2. java.lang.Exception: DEBUG STACK TRACE for PoolBackedDataSource.close().

    java.lang.Exception: DEBUG STACK TRACE for PoolBackedDataSource.close(). java.lang.Exception: DEBUG ...

  3. 关于CLOSE BY CLIENT STACK TRACE

    关于CLOSE BY CLIENT STACK TRACE 程序正常运行,数据库连接可以获取,一些列操作都可以实现,可在debug信息中总会一段时间就报如下错误: java.lang.Exceptio ...

  4. jedis:exception is java.lang.VerifyError: Bad type on operand stack

    项目中需要用到缓存,经过比较后,选择了redis,客户端使用jedis连接,也使用到了spring提供的spring-data-redis.配置正确后启动tomcat,发现如下异常: ======== ...

  5. Jedis:Exception in thread "main" java.lang.VerifyError: Bad type on operand stack

    Exception in thread "main" java.lang.VerifyError: Bad type on operand stackException Detai ...

  6. jeecg报错:java.lang.Exception: No runnable methods

    具体报错如下 ------------------------------------------------------- T E S T S --------------------------- ...

  7. keytool 错误: java.lang.Exception: 密钥库文件不存在: keystore

    通过Android Studio编译器获取SHA1 第一步.打开Android Studio的Terminal工具 第二步.输入命令:keytool -v -list -keystore keysto ...

  8. junit test 报错,java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=esopCreateTest],

    java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=esopCreateTest], {ExactMatc ...

  9. PROPAGATION_REQUIRED,ISOLATION_DEFAULT; '',-java.lang.Exception

    转https://stackoverflow.com/questions/29117679/spring-transactional-management-propagation-required-i ...

随机推荐

  1. k8s学习笔记(一)

    你将学到什么 如何部署k8s集群 网络拓扑 主机名 网络地址 角色 study 92.0.0.50(内网) 192.168.203.250/19(外网) Master fnode 92.0.0.16( ...

  2. 20165219 《Java程序设计》实验一(Java开发环境的熟悉)实验报告

    20165219 <Java程序设计>实验一(Java开发环境的熟悉)实验报告 一.实验报告封面 课程:Java程序设计 班级:1652班 姓名:王彦博 学号:20165219 成绩: 指 ...

  3. 871. Minimum Number of Refueling Stops

    A car travels from a starting position to a destination which is target miles east of the starting p ...

  4. kali linux之被动信息收集(dns信息收集,区域传输,字典爆破)

    公开可获取的信息,不与目标系统产生交互,避免留下痕迹 下图来自美军方 pdf链接:http://www.fas.org/irp/doddir/army/atp2-22-9.pdf 信息收集内容(可利用 ...

  5. loj#6041. 「雅礼集训 2017 Day7」事情的相似度(后缀自动机+启发式合并)

    题面 传送门 题解 为什么成天有人想搞些大新闻 这里写的是\(yyb\)巨巨说的启发式合并的做法(虽然\(LCT\)的做法不知道比它快到哪里去了--) 建出\(SAM\),那么两个前缀的最长公共后缀就 ...

  6. ssh 操作

    1.登录 ssh 用户名@远程地址 2.拷贝:scp -r 本地文件夹 远程文件夹(user@ip:目录) 3.从ssh中临时退出: a. ~  (control+z) b.查看后台任务:jobs c ...

  7. 什么是LINQ

    LINQ 什么是LINQLINQ提供程序 匿名类型 方法语法和查询语法查询变量查询表达式的结构 from子句join子句什么是联结查询主体中的from…let…where片段 from子句let子句w ...

  8. Android 文字转语音(TTS)

    1.介绍 2.xml文件布局 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xml ...

  9. Spring Boot 例一 实现jsonp接口

    1.新建项目(选择quikstart) 2.增加spring boot 依赖 <dependency> <groupId>org.springframework.boot< ...

  10. 1095 解码PAT准考证 (25 分)

    PAT 准考证号由 4 部分组成: 第 1 位是级别,即 T 代表顶级:A 代表甲级:B 代表乙级: 第 2~4 位是考场编号,范围从 101 到 999: 第 5~10 位是考试日期,格式为年.月. ...