Solved Find class from a Module

Discussion in 'Spigot Plugin Development' started by MaTaMoR_, May 14, 2016.

  1. Hi, i created something like "Modules", well i just modified some stuff from bukkit and made it work, so right now i have a folder inside my plugin named "Modules" and i just have to drop my Modules there (please don't suggest just make it a normal plugin, i have my reasons to do it), so the problem is when i try to acces from my plugin to one of my Modules, it always throws a ClassNotFoundException, and i think it's because the Module classes aren't loaded into PluginClassLoader, but im not sure, so please send halp.
  2. A few things here..

    a) Can I See a stacktrace please?

    b) are you making a module system to add functionality to your plugins? Similar to votifier?

    c) module classes wouldnt be loaded by the pluginclassloader, you get to make your own classloader to load them in..
  3. a)
    b) Yes
    c) I already have a custom class loader, and it works fine the Modules are loaded fine and everything, but when i try to acces to my Modules using my Plugin it always throws a ClassNotFoundException.
  4. Does this class exsist? : me.matamor.swskills.SkyWarsSkills

    Can I see a screenshot of your classpath the verify this?

    also is swskills the module or is it part of the plugin?

    Also, are you accessing the module with reflection? If not, how are you accessing the module?
  5. Of course the class exists, the module is perfectly working, the problem comes when i try to acces a class from the Module (im directly accesing it adding the Module as dependency)
  6. Seems like i managed to fix it, when i enable the Module and the CustomClassLoader finds a class i put it with reflections in the Map containing the classes in the PluginClassLoader.