SQLLite problems

Discussion in 'Plugin Development' started by matejdro, Jan 22, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    matejdro

    I can't get SQLLite to work. Here is my code (borrowed from BigBrother plugin, i promise i will give you the credit):

    Code:
    Class.forName("org.sqlite.JDBC");
    Connection ret = DriverManager.getConnection("jdbc:sqlite:" + File.separator + "MyPlugin" + File.separator + "myplugin.db");
    ret.setAutoCommit(false);
    
    But i keep getting this error:

    I have added SQLLite library (sqlitejdbc-v056.jar) to the Java Build Path in Eclipse and i have that file in my server folder. Anything else that I'm missing? Please help.
     
  2. Offline

    Timberjaw

  3. Offline

    matejdro

    Thanks for your reply!

    Althrough it appears i'm still doing something wrong. This is my manifest:

    Code:
    Manifest-Version: 1.0
    Class-Path: sqlitejdbc-v056.jar
    I have also tried "../sqlitejdbc-v056.jar", but still no luck (same error).

    Where is manifest located? I have opened resulting JAR with WinRar and found manifest in META-INF folder. But that file was without class path (only manifest version line). I have selected "Use existing manifest" in Eclipse. Anyway, i have also tried manually replaced manifest with my one, but still same error.

    Why do i always have problem with such basics? [​IMG]
     
  4. Offline

    tkelly

    Try adding an extra line after the Class-Path. Manifest files can be picky.

    If you're doing the Use Existing Manifest, that should work
     
  5. Offline

    matejdro

    Still no luck [​IMG]

    Maybe it have something to do with the fact that i use 64 bit java?
     
  6. Offline

    tkelly

    That shouldn't matter.

    You have to make sure the paths matchup, so if you're using ../sqlitejdbc-v056.jar, the jar file is in the same folder as CraftBukkit
     
  7. Offline

    paletas

    Try using a complete path just to test, if it works with that the problem is your relative path.
     
  8. Offline

    matejdro

    Tried ../ and same error.

    Absolute path gives me "org.bukkit.plugin.InvalidPluginException" error.

    Code:
    Manifest-Version: 1.0
    Class-Path: X:\BukkitTest\sqlitejdbc-v056.jar
    Code:
    22.1.2011 20:43:39 org.bukkit.plugin.SimplePluginManager loadPlugins
    SEVERE: Could not load plugins\Jail.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:83)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:117)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:82)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:43)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:153)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:140)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:104)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:177)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.lang.ClassNotFoundException: com.matejdro.bukkit.jail.Jail
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:29)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:77)
            ... 8 more
     
  9. Offline

    Timberjaw

    My working manifest (Manifest.txt) looks like:
    Code:
    Manifest-Version: 1.0
    Class-Path: ../sqlitejdbc-v056.jar
    
    
    Note the line break after the class-path line. My manifest file is within my Eclipse workspace; not sure if that matters or not. Checking META-INF in the finished jar is a good idea.

    My suggestion is to go back and methodically double-check everything again. Look at your manifest and make sure that it has a line break. When you export, go through methodically and make sure you're not missing anything. It's easy to make tiny mistakes that cause big problems. :)
     
  10. Offline

    matejdro

    Guys, I'm such an idiot.

    Before trying Manifest, i was also testing if maybe it would work with mysql. And then i left settings on mysql. So i was keep doing Manifest for SQLLite, while plugin wanted to use MySQL. And of course i didn't looked at error closely.

    Thank you really much for your help.
     
  11. Offline

    matjam

    This thread was interesting to me, as I'm currently looking at using sqlite myself.

    What happens when you have multiple plugins all using sqlite?
    Do we expect the above method for loading the jar to work?
    Should the server be started with the sqlite jar (or a libdir) added to the classpath?

    I can see this heading down the path of tomcat where server administrators need to manage a list of the dependencies of all their plugins and try to keep them up to date, along with trying to resolve conflicts - plugin foo needs barlib-1.0 but plugin baz only works with barlib-0.9.

    Yowzers.
     
Thread Status:
Not open for further replies.

Share This Page