When you create an Anvil inventory using:
Inventory inv = Bukkit.createInventory(player, InventoryType.ANVIL); player.openInventory(inv);
If you click on any items in your inventory or in the anvil itself, it just spams the console with this error:
http://pastebin.com/VPsFyAim