![](/img/trans.png)
[英]How to log JDBC connection info on org.springframework.jdbc.CannotGetJdbcConnectionException
[英]org.springframework.jdbc.CannotGetJdbcConnectionException
我在 spring3 项目中工作。 当我运行我的代码时,有时我会得到这个 Jdbc 连接异常,用于某些特定功能,但其他功能工作得很好。 而且这个异常并没有重复发生,但有时,所以我不知道错误在哪里。 请帮助我摆脱这个问题。
<[weblogic.servlet.internal.WebAppServletContext@1b6e978 - appName:'_auto_generated_ear_',名称:'ae',上下文路径:'/ae'] ServletException 的根本原因。 org.springframework.jdbc.CannotGetJdbcConnectionException:无法获得 JDBC 连接; nested exception is java.sql.SQLException: Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: localhost:1521:XE at org.springframework.jdbc. datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:573) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:666) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:674) Truncated. see log file for complete stacktrace java.sql.SQLException: Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: localhost:1521:XE at oracle.jdbc .driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387) at oracle.在 oracle63A6 58CE6080CAA87C7Z.driver.T4CConnection.(T4CConnection.java:165) 被截断。 查看日志文件以获取完整的堆栈跟踪
这种症状有两个常见原因
要解决此问题,只需重新启动您的 MySQL 服务
如何重启MySQL服务
在 Windows 上: https://www.mysqltutorial.org/mysql-adminsitration/restart-mysql
在 Linux 上: https://linuxhint.com/restart-mysql-in-ubuntu/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.