Spigot CRUDStorage 1.1

MySQL database without SQL query

  1. Rafoudiablol submitted a new resource:

    CRUDStorage - A common interface to store data + MySQL implementation

    Read more about this resource...
     
  2. Nice resource, but how do I get it working inside a running Spigot enviorment?
    After implementation I get this error:
    Code (Text):
    java.lang.NoClassDefFoundError: net/rafoudiablol/api/crud/sql/BeanCRUDful
            at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_221]
            at java.lang.ClassLoader.defineClass(Unknown Source) ~[?:1.8.0_221]
            at java.security.SecureClassLoader.defineClass(Unknown Source) ~[?:1.8.0_221]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:131) ~[spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:202) ~[spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:92) ~[spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:81) ~[spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_221]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_221]
            at me.hydro.basics.BasicPlugin.onEnable(BasicPlugin.java:25) ~[?:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:352) [spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:417) [spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugin(CraftServer.java:461) [spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugins(CraftServer.java:375) [spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at net.minecraft.server.v1_14_R1.MinecraftServer.a(MinecraftServer.java:449) [spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at net.minecraft.server.v1_14_R1.DedicatedServer.init(DedicatedServer.java:268) [spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:774) [spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
    Caused by: java.lang.ClassNotFoundException: net.rafoudiablol.api.crud.sql.BeanCRUDful
            at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_221]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:135) ~[spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:81) ~[spigot-1.14.4.jar:git-Spigot-1981d55-da62a66]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_221]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_221]
            ... 19 more
    EDIT: It works now
     
    #3 HydroTekZ, Dec 25, 2019
    Last edited: Jan 7, 2020
  3. Thanks for reply and evaluation!

    This error is an error caused by a class not found by the class loader. You probably don't exported the classes inside your plugin! Because the API does not provide main pluggin for Bukkit and can work with any Java application lib, you need to export inside the JAR of your plugin.
     
    • Friendly Friendly x 1
  4. Hi @Rafoudiablol
    How do I get a list in sorted order by for example a balance field?
    And I didnt get how I can get/search with multiple parameters for multiple fields, if that is even possible.
     
  5. Hey, yes it is possible.
    You have to implements the method getSortColumn() to return the name of your balance field in the database.
    For now, you can search for one field with the search(String field, E value). To search for multiple fields, if i've understood correctly, you have to make an individual search for all fields and get elements in common, I think there is a method like this in Java.
    So yes, it's possible, even I didn't tested it :)