alecgorge/jsonapi — Issue #100: (Vague bug-like problem) IncompatibleClassChangeError leads to BindException.
Author: Psithief
Created: 2011-12-08 12:36:18+00:00
State: open

## IncompatibleClassChangeError leads to BindException.

```
[SEVERE] Error occurred while enabling JSONAPI v3.0.0 (Is it up to date?): class com.alecgorge.minecraft.jsonapi.dynamic.APIWrapperMethods has interface org.bukkit.command.ConsoleCommandSender as super class
java.lang.IncompatibleClassChangeError: class com.alecgorge.minecraft.jsonapi.dynamic.APIWrapperMethods has interface org.bukkit.command.ConsoleCommandSender as super class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
at org.bukkit.plugin.java.JavaPluginLoader.getClassByName(JavaPluginLoader.java:221)
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:32)
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at com.alecgorge.minecraft.jsonapi.dynamic.Call.(Call.java:16)
at com.alecgorge.minecraft.jsonapi.dynamic.Method.(Method.java:47)
at com.alecgorge.minecraft.jsonapi.dynamic.Caller.proccessMethodsWithNamespace(Caller.java:181)
at com.alecgorge.minecraft.jsonapi.dynamic.Caller.magicWithMethods(Caller.java:147)
at com.alecgorge.minecraft.jsonapi.dynamic.Caller.loadFile(Caller.java:99)
at com.alecgorge.minecraft.jsonapi.JSONServer.(JSONServer.java:50)
at com.alecgorge.minecraft.jsonapi.JSONAPI.onEnable(JSONAPI.java:326)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:342)
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:329)
at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:165)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:393)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
```

## **After /reload issued:**

```
[JSONAPI] Couldn't start server!

[SEVERE] java.net.BindException: Address already in use
[SEVERE] at java.net.PlainSocketImpl.socketBind(Native Method)
[SEVERE] at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:353)
[SEVERE] at java.net.ServerSocket.bind(ServerSocket.java:336)
[SEVERE] at java.net.ServerSocket.(ServerSocket.java:202)
[SEVERE] at com.alecgorge.minecraft.jsonapi.NanoHTTPD.(NanoHTTPD.java:271)
[SEVERE] at com.alecgorge.minecraft.jsonapi.NanoHTTPD.(NanoHTTPD.java:297)
[SEVERE] at com.alecgorge.minecraft.jsonapi.JSONServer.(JSONServer.java:46)
[SEVERE] at com.alecgorge.minecraft.jsonapi.JSONAPI.onEnable(JSONAPI.java:326)
[SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
[SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
[SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
[SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
[SEVERE] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
[SEVERE] at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:432)
[SEVERE] at org.bukkit.Bukkit.reload(Bukkit.java:187)
[SEVERE] at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:22)
[SEVERE] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:165)
[SEVERE] at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:374)
[SEVERE] at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:370)
[SEVERE] at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:558)
[SEVERE] at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:535)
[SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:419)
[SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
```

CB 1565.
**Cause:** CB breaking change, turning ConsoleCommandSender into an interface.
*See https://github.com/Bukkit/CraftBukkit/commit/a15200f553542ae5da66414e091884c503742bbf*