0

I got a error called java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z when I connected IDEA with mysql database. I think my configuration is correct as below.In addition, the test is successful. The configuration pic

And then the something stranger happened. I cannot get the any schemes from my database on the database tool window,but I can get them with Navicat. When I type SELECT * FROM message into console, that error appeared as below.

[2017-03-29 17:51:28] java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z
[2017-03-29 17:51:28]   at com.intellij.database.remote.jdbc.impl.RemoteConnectionImpl.isValid(RemoteConnectionImpl.java:108)
[2017-03-29 17:51:28]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2017-03-29 17:51:28]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[2017-03-29 17:51:28]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2017-03-29 17:51:28]   at java.lang.reflect.Method.invoke(Method.java:497)
[2017-03-29 17:51:28]   at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
[2017-03-29 17:51:28]   at sun.rmi.transport.Transport$1.run(Transport.java:200)
[2017-03-29 17:51:28]   at sun.rmi.transport.Transport$1.run(Transport.java:197)
[2017-03-29 17:51:28]   at java.security.AccessController.doPrivileged(Native Method)
[2017-03-29 17:51:28]   at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
[2017-03-29 17:51:28]   at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
[2017-03-29 17:51:28]   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
[2017-03-29 17:51:28]   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$256(TCPTransport.java:683)
[2017-03-29 17:51:28]   at java.security.AccessController.doPrivileged(Native Method)
[2017-03-29 17:51:28]   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
[2017-03-29 17:51:28]   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[2017-03-29 17:51:28]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[2017-03-29 17:51:28]   at java.lang.Thread.run(Thread.java:745)

I search Internet for this question via google, then I upgrade mysql driver to even ver.5.1.40.But it doesn't work as well. The driver pic

So, How to deal with this error? It stuck me two days. Thanks in advance.

Community
  • 1
  • 1

2 Answers2

0

java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z

This will help you.

I think you have to remove the previous MySQL driver.

Community
  • 1
  • 1
Nidhi257
  • 754
  • 1
  • 5
  • 23
  • I upgraded the MySQL driver, But it doesn't work and there is only one driver used by Intellij IDEA which is got from Intellij itself. – Arthur Chen Mar 29 '17 at 09:47
  • which version of java are you using? – Nidhi257 Mar 29 '17 at 09:53
  • java version: 1.8.0_71 – Arthur Chen Mar 29 '17 at 10:01
  • try to update your JDK from oracle JDK to open JDK 1.8. this link will help you https://intellij-support.jetbrains.com/hc/en-us/community/posts/203366264-MySQL-connection-jdbc-com-mysql-jdbc-Connection-isValid-I-Z-SOLVED- – Nidhi257 Mar 29 '17 at 10:05
  • I downloaded the IntelliJ x64 JDK from link given by Eugene Morozov and unzipped it. Then, Set the the unzip directory as IDEA_JDK_64 environment variable.But it still didn't work. Afterwards, I downloaded a latest Version of Intellij IDEA and installed it.It also didn't work.Why? – Arthur Chen Apr 01 '17 at 03:17
  • can you please attach the screen shot? – Nidhi257 Apr 02 '17 at 11:50
0

I solved it by changing to the older version of IDEA. When I used the database of IDEA of Version 2016.1.4, it did work.