简体   繁体   English

SQLException堆栈跟踪

[英]SQLException stack trace

So I got sort of strange situation. 所以我有点奇怪的情况。 I have Spring webapp and in it I have JNDI datasource that I have defined in tomcat's server.xml to connect to mysql database I have mysql-connector-java 5.1.2 in my Maven pom. 我有Spring webapp,其中有我在tomcat的server.xml中定义的JNDI数据源以连接到mysql数据库,我的Maven pom中有mysql-connector-java 5.1.2。

Application works when I start it from localhost, but when I deploy it to remote tomcat it is not getting the call to the database. 当我从本地主机启动应用程序时,它可以工作,但是当我将其部署到远程tomcat时,它无法获得对数据库的调用。

This Exception occurs : 发生此异常:

Couldnt execute sql CALL shareholders_company_list(?)
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Unable to create correct SQLException class instance, error class/codes may be incorrect. Reason:

** BEGIN NESTED EXCEPTION **

java.sql.SQLException
MESSAGE: Can't instantiate required class due to java.lang.ClassNotFoundException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException

STACKTRACE:

java.sql.SQLException: Can't instantiate required class due to java.lang.ClassNotFoundException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException

Is there away to avoid this ClassNotFoundException, so that I can get full stack trace, since it seems that explicit error why this happens is in MySQLNonTransientConnectionException, and I can't seem to reach it. 有没有避免这种ClassNotFoundException的方法,所以我可以获得完整的堆栈跟踪信息,因为看来发生这种情况的显式错误是在MySQLNonTransientConnectionException中,而且我似乎无法达到。

tomcat\\libmysql-connector-java-latestVersion.jar所需版本(如果没有优先级,则为最新版本)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM