The following error occurs when using hibernate
java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920) at com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1074) at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3590) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2531) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2301) at com.mysql.jdbc.ConnectionImpl. < init > (ConnectionImpl.java:834) at com.mysql.jdbc.JDBC4Connection. < init > (JDBC4Connection.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:215) at zttc.itat.user.util.DbUtil.getConnection(DbUtil.java:12) at zttc.itat.user.util.AbstractDbUnitTestCase.init(AbstractDbUnitTestCase.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Later, it was solved by replacing mysql-connector-java-5.1.24.jar with mysql-connector-java-5.1.46.jar.
Similar Posts:
- Java.math.BigInteger cannot be cast to java.lang.Long [How to Solve]
- Project startup error: communications link failure
- com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
- Error occurred when Android connected to cloud MySQL: java.lang.NoClassDefFoundError : Failed resolution of: Ljava/sql/SQLType
- SSM Project Error: java.sql.SQLException: Access denied for user ‘????…§’@’localhost’ (…
- [java & MySql] Path does not chain with any of the trust anchors
- Duplicate entry ‘1’ for key ‘PRIMARY'() [How to Solve]
- [Solved] Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
- [Solved] The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more than one time zone
- [Solved] ### Error querying database. Cause: java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more XXXXX