Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidPluginException: Cannot find main class path.to.MainClass when Packager is enabled #157

Open
Skwrr opened this issue Sep 13, 2023 · 0 comments

Comments

@Skwrr
Copy link

Skwrr commented Sep 13, 2023

Bug Report

Expected Behaviour

Run the plugin as normal, like if packager weren't enabled

Actual Behaviour

When the obfuscated plugin with packager loads, it throws

Could not load 'plugins\vBases-obf.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.skwrr.vbases.vBases'
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:65) ~[server.jar:1.8.8-R0.2-SNAPSHOT]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:113) ~[server.jar:1.8.8-R0.2-SNAPSHOT]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:314) ~[server.jar:1.8.8-R0.2-SNAPSHOT]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:232) ~[server.jar:1.8.8-R0.2-SNAPSHOT]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:311) ~[server.jar:1.8.8-R0.2-SNAPSHOT]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(Unknown Source) ~[server.jar:1.8.8-R0.2-SNAPSHOT]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(Unknown Source) ~[server.jar:1.8.8-R0.2-SNAPSHOT]
        at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_381]
Caused by: java.lang.ClassNotFoundException: me.skwrr.vbases.vBases
        at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_381]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:100) ~[server.jar:1.8.8-R0.2-SNAPSHOT]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:85) ~[server.jar:1.8.8-R0.2-SNAPSHOT]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_381]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_381]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_381]
        at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_381]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:63) ~[server.jar:1.8.8-R0.2-SNAPSHOT]
        ... 7 more

How to reproduce the behaviour

Load this file as config (change the input jar, output jar and libraries) https://www.mediafire.com/file/qvyq4aobpt2eb5n/Config.jocfg/file
Obfuscate and it will success
Use it in a minecraft server and it will throw that error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant