[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. 用C语言构建一个可执行程序的流程

    1.流程图 从用C语言写源代码,然后经过编译器.连接器到最终可执行程序的流程图大致如下图所示. 2.编译流程 首先,我们先用C语言把源代码写好,然后交给C语言编译器.C语言编译器内部分为前端和后端. ...

  2. 「CF622F」The Sum of the k-th Powers「拉格朗日插值」

    题意 求\(\sum_{i=1}^n i^k\),\(n \leq 10^9,k \leq 10^6\) 题解 观察可得答案是一个\(k+1\)次多项式,我们找\(k+2\)个值带进去然后拉格朗日插值 ...

  3. 一款很好用的页面滚动元素动画插件-AOS.JS

    aos.js是一款效果超赞的页面滚动元素动画jQuery动画库插件.该动画库可以在页面滚动时提供28种不同的元素动画效果,以及多种easing效果.在页面往回滚动时,元素会恢复到原来的状态. 加载方法 ...

  4. 25.Remove Nth Node From End of List(删除链表的倒数第n个节点)

    Level:   Medium 题目描述: Given a linked list, remove the n-th node from the end of list and return its ...

  5. Navicat Premium 12破解激活

    下载Navicat Premium 12并安装: 蓝奏云下载:Navicat Premium 12注册机   链接:https://pan.baidu.com/s/1mN-urlh--SX1vbq7h ...

  6. Flask之flask_script

    flask端口占用 解决方案: lsof -i:5000 #查询是哪个进程占用的 kill PID 杀掉进程 flask_script之Manager类 from flask import Flask ...

  7. 一个数字从后向前输入每一位数字,Camel和Pascal命名规范,IsValid()

    int num = int.Parse(Console.ReadLine()); ; ) { n = num % ; num /= ; Console.WriteLine(n); } Camel和Pa ...

  8. 【字符串】【hash】【倍增】洛谷 P3502 [POI2010]CHO-Hamsters 题解

        这是一道字符串建模+图论的问题. 题目描述 Byteasar breeds hamsters. Each hamster has a unique name, consisting of lo ...

  9. stopPropagation / stopImmediatePropagation

      stopPropagation()只会阻止冒泡或者是捕获. stopImmediatePropagation()会阻止该元素的其他事件发生,但是stopPropagation就不会阻止其他事件的发 ...

  10. C# 错误和异常

    Try,catch和finally语句组成 异常层次结构 部分异常属性: Message 类型:string 描述:含有解释异常原因的消息(只读) StackTrace 类型:string 描述:含有 ...