So I'm building a minecraft plugin, one part of the plugin grabs a bunch of block data from mysql and loads it into a cache when the server starts. I have a bit of code that runs fine in eclipse test cases. However when I load the plugin in a local minecraft server the I get the exception.
java.lang.AbstractMethodError: Method com/mysql/jdbc/JDBC4ResultSet.getObject(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object; is abstract at com.mysql.jdbc.JDBC4ResultSet.getObject(JDBC4ResultSet.java) ~[spigot-1.8.8.jar:git-Spigot-db6de12-d3e0b6f] at fws.plugins.trigger.database.ModelDB.loadCollection(ModelDB.java:335) ~[?:?] at fws.plugins.trigger.database.ModelDB.all(ModelDB.java:295) ~[?:?] etc...
The bit of code that is throwing the exeption.
rs.getObject( field.getName(), p.fieldType());
rs
is a java.sql.ResultSet
instance returned from a excuted query.
p.fieldType()
just returns a Class<?>
Slightly bigger snippet... not that it really shows you anything else.
if (field.isAnnotationPresent(Persist.class)) {
try {
Persist p = field.getAnnotation(Persist.class);
Object o = rs.getObject( field.getName(), p.fieldType());
field.set(m,p.fieldType().cast(o));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
I have looked online people said to fix I need to include ojdbc6.jar and use it as my Connection Driver.
I added the file to the project structure under a folder lib, included it to my project then added it to my Build File.
http://i.imgur.com/7TXLbjj.png
and changed the connection driver to oracle.jdbc.OracleDriver
However im getting the same issue, seems like not a fix. Although chances are i have done it all wrong.
Can anyone help me, any insights etc?
EDIT**
from the commandline
$ java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
from Eclipse
System.out.println(System.getProperty("java.runtime.version"));
returns 1.8.0_51-b16
But both are on the same PC, so i would expect the same values?