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

Plugin incompatibility for some reason #1971

Closed
AuroraLS3 opened this issue Jun 19, 2020 · 2 comments
Closed

Plugin incompatibility for some reason #1971

AuroraLS3 opened this issue Jun 19, 2020 · 2 comments

Comments

@AuroraLS3
Copy link

Issue description

Hi,
a bug was reported by a user of my plugin, that somehow my plugin was breaking AAC.
plan-player-analytics/Plan#1492

I unfortunately was unable to figure out the cause, but here is the exception, could you help me figure what could be the cause? I don't think it is an issue in my plugin because it does not inject anything

Stacktrace (Click to open)
> [03:10:22 INFO]: [AAC] Attempting to inject into PlayerConnection
> [03:10:23 ERROR]: [AAC] ERROR: Failed to inject into PlayerConnection.class: 1
> [03:10:23 ERROR]: [AAC] The Move check WILL NOT function correctly.
> [03:10:23 ERROR]: Could not load 'plugins/AAC-4.3.12.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.ExceptionInInitializerError
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:331) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:254) [patched.jar:git-PaperSpigot-"4c7641d"]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:293) [patched.jar:git-PaperSpigot-"4c7641d"]
    at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:202) [patched.jar:git-PaperSpigot-"4c7641d"]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched.jar:git-PaperSpigot-"4c7641d"]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
Caused by: java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_242]
    at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_242]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:65) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    ... 6 more
Caused by: java.lang.RuntimeException: Failed to inject into PlayerConnection.class
    at me.konsolas.aac.aQ.run(aQ.java) ~[?:?]
    at me.konsolas.aac.AAC.<clinit>(AAC.java) ~[?:?]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_242]
    at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_242]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:65) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[patched.jar:git-PaperSpigot-"4c7641d"]
    ... 6 more
> [03:10:23 ERROR]: Could not load 'plugins/AACPlus-2.3.2.jar' in folder 'plugins'
org.bukkit.plugin.UnknownDependencyException: AAC
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:222) [patched.jar:git-PaperSpigot-"4c7641d"]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:293) [patched.jar:git-PaperSpigot-"4c7641d"]
    at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:202) [patched.jar:git-PaperSpigot-"4c7641d"]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched.jar:git-PaperSpigot-"4c7641d"]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]

Core information

Server version: PaperMC 1.15.2 Build 201

AAC version: unknown, assuming 4.3.11 based on release dates and issue send date

ProtocolLib version:

Plugin list: Plan build 600 (https://github.com/plan-player-analytics/Plan/releases/download/5.1.600/Plan-5.1-build-600.jar)

Special environment information

I don't unfortunately have any more information

@Janmm14
Copy link
Collaborator

Janmm14 commented Jun 19, 2020

Change reflections to lazy load on first access.

Your plugin uses reflection stuff too early for AAC.

AAC 4 reads that class from server jar as early as possible and then force-loads a modified version so the original from the jar is not touched.

Please make net.minecraft.server reflection lazyloading or make sure its not loaded before your plugin's onEnable method.

Adding aac as softdependency (or similar things) does not help in this case, as static init of plugin classes is done in parallel.

@AuroraLS3
Copy link
Author

Thanks, that makes sense, as the plugin checks Player class for ping method on enable.

AuroraLS3 added a commit to plan-player-analytics/Plan that referenced this issue Aug 8, 2020
This static block was causing compatibility issues with some plugins that
modify classes at runtime.

Affects issues:
- Possibly fixed #1492
- References konsolas/AAC-Issues#1971
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

2 participants