[英]UndeclaredThrowableException due to SQLException in Spring + iBatis?
I am getting the following exception when I typo the SQL driver name or the database server is offline, basically any SQLException. 当我输入SQL驱动程序名称或数据库服务器脱机时,出现以下异常,基本上是任何SQLException。
I can't determine where the UndeclaredThrowableException is coming from. 我无法确定UndeclaredThrowableException的来源。 Line 194 in SqlMapClientTemplate is this: SqlMapClientTemplate中的第194行是这样的:
logger.debug("Obtained JDBC Connection [" + springCon + "] for iBATIS operation");
Here is the trace: 这是跟踪:
java.lang.reflect.UndeclaredThrowableException $Proxy59.toString(Unknown Source) java.lang.String.valueOf(Unknown Source) java.lang.StringBuffer.append(Unknown Source) org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:194) org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:249) org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:296) org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:290)
some of my reading points to some type of class loading problem? 我的一些阅读指向某些类加载问题? I can't figure out where the $Proxy is getting introduced? 我不知道在哪里引入$ Proxy?
The $Proxy59
class must be the type of the springCon
variable. 在$Proxy59
类必须是类型springCon
变量。 It is a JDK proxy type, probably introduced by the Spring framework, as a wrapper for the real connection. 它是JDK代理类型,可能是Spring框架引入的,作为实际连接的包装。 I know of a pooled connection provider that returns connections which suppress the close()
method via a proxy (because the connection is pooled, calling close is not the client's task). 我知道有一个池化连接提供程序,该提供程序返回通过代理来抑制close()
方法的连接(因为连接是池化的,因此调用close不是客户端的任务)。
Maybe the proxy's handler for the toString()
method throws a checked exception, which is possible with the proxy mechanics, but not allowed. 也许toString()
方法的代理处理程序会引发一个已检查的异常,这对于代理机制而言是可能的,但不允许这样做。
The Java Documentation says: Java文档说:
Do you get any other exception logged, maybe directly before that, or mentioned as the exception cause? 您是否还记录了其他任何异常,也许是在此之前,或者被提及为异常原因?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.