So, I create a minecraft plugin, one part of the plugin grabs a bunch of block data from mysql and loads it into the cache when the server starts. I have some code that works fine in eclipse tests. However, when I load the plugin on the local minecraft server, I get an 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.javahaps35) ~ [?:?]
at fws.plugins.trigger.database.ModelDB.all (ModelDB.java:295) ~ [?:?]
etc ...
A bit of code that challenges.
rs.getObject( field.getName(), p.fieldType());
rsis the instance java.sql.ResultSetreturned from the deductible request.
p.fieldType()returns aClass<?>
A bit larger 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) {
e.printStackTrace();
}
}
I looked at online users who decided to fix it. I need to enable ojdbc6.jar and use it as my connection driver.
I added the file to the project structure under the lib folder, included it in my project and added it to my build file.
http://i.imgur.com/7TXLbjj.png
and changed the connection driver tooracle.jdbc.OracleDriver
However, I get the same problem, it seems not a fix. Although it is likely that I did all this wrong.
Can anybody help me, any ideas, etc.
EDIT **
from the command line
$ 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
, ?