SpectatorPlus

SpectatorPlus

34.1k Downloads

Reflection exception on /spec on

pgmann opened this issue ยท 8 comments

commented

When I did /spec on a massive error appeared.

[18:09:28 ERROR]: [SpectatorPlus] Reflection exception caught while trying to check collisions status for pgmann
java.lang.IllegalAccessException: Class com.pgcraft.spectatorplus.tools.reflection.Reflection can not access a member of class org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer$1 with modifiers "public"
    at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:110) ~[?:1.7.0_91]
    at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:262) ~[?:1.7.0_91]
    at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:254) ~[?:1.7.0_91]
    at java.lang.reflect.Method.invoke(Method.java:599) ~[?:1.7.0_91]
    at com.pgcraft.spectatorplus.tools.reflection.Reflection.call(Reflection.java:314) ~[SpectatorPlus-B3.0.jar:?]
    at com.pgcraft.spectatorplus.tools.reflection.Reflection.call(Reflection.java:284) ~[SpectatorPlus-B3.0.jar:?]
    at com.pgcraft.spectatorplus.utils.Collisions.collidesWithEntities(Collisions.java:68) [SpectatorPlus-B3.0.jar:?]
    at com.pgcraft.spectatorplus.spectators.Spectator.enableSpectatorMode(Spectator.java:186) [SpectatorPlus-B3.0.jar:?]
    at com.pgcraft.spectatorplus.spectators.Spectator.setSpectating(Spectator.java:156) [SpectatorPlus-B3.0.jar:?]
    at com.pgcraft.spectatorplus.spectators.Spectator.setSpectating(Spectator.java:135) [SpectatorPlus-B3.0.jar:?]
    at com.pgcraft.spectatorplus.spectators.Spectator.setSpectating(Spectator.java:123) [SpectatorPlus-B3.0.jar:?]
    at com.pgcraft.spectatorplus.commands.users.EnableSpectatorModeCommand.run(EnableSpectatorModeCommand.java:34) [SpectatorPlus-B3.0.jar:?]
    at com.pgcraft.spectatorplus.components.commands.Command.execute(Command.java:96) [SpectatorPlus-B3.0.jar:?]
    at com.pgcraft.spectatorplus.components.commands.CommandGroup.executeMatchingCommand(CommandGroup.java:171) [SpectatorPlus-B3.0.jar:?]
    at com.pgcraft.spectatorplus.components.commands.CommandGroup.executeMatchingCommand(CommandGroup.java:163) [SpectatorPlus-B3.0.jar:?]
    at com.pgcraft.spectatorplus.components.commands.CommandGroup.onCommand(CommandGroup.java:189) [SpectatorPlus-B3.0.jar:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [spigot.jar:git-Spigot-db6de12-07c3001]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot.jar:git-Spigot-db6de12-07c3001]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) [spigot.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1162) [spigot.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997) [spigot.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot.jar:git-Spigot-db6de12-07c3001]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_91]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_91]
    at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-db6de12-07c3001]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-db6de12-07c3001]
    at java.lang.Thread.run(Thread.java:745) [?:1.7.0_91]

I have onSpectateModeChanged.teleportation.... both set to false. Otherwise all is as normal.

commented

Weird, the method should be accessible, especially with a public modifier.
It should work fine if you ignore the error, this said.

commented

I may be reading this wrong, but where do you allow access to the spigot() method? Do you need to call setAccessible() in zLib (https://github.com/zDevelopers/zLib/blob/master/src/main/java/fr/zcraft/zlib/tools/reflection/Reflection.java#L313)?

commented

I never explicitly allowed the access to the method as it's a public method. I may have to.

commented

Did you push to zLib after this commit or is Jenkins still caching the artifacts?

commented

Some other commits were pushed to fix compilation for Java < 8. The problem still exists? I checked on my side (with Spigot 1.9.2) without problem.

The compilation fail (build 20) was caused by an error in zLib, the compilation problem for Java < 8 mentioned above.

commented

@TiTo-418, please try the latest dev build on Jenkins.

(I will test too if I get time)

commented

Closed by the commit above, but the plugin needs to be recompiled to retrieve the zLib updates.

BUT: #65.

commented

@pgmann The error is fixed, but I'm still able to push entities