mojira.dev
MC-42286

Multiplayer server: "Internal Exception: java.lang.ClassCastException: bit cannot cast to fm"

Every time i try and connect to specific servers, I get an error while connecting which either says
"Internal Exception: java.lang.ClassCastException: bit cannot cast to fm"

or "kicked while connecting to "server name". You are not logged in"

or it says "Internal Exception: java.lang.ClassCastException: bju cannot cast to fm"

Other people can connect to this server fine. I tried it on other accounts and it works, leading me to believe this is a problem with my account alone. I am not banned, or blocked from the server in anyway. Is there anyway to fix this so that I can play?

(Also i looked this up, the best option for a fix was change the render distance to 2, and put frame rate to max. I tried that and it didn't work.)

Linked issues

Comments 6

there is...
you have to contact the host
there is something wrong with your player.dat
its not your fault it just happens sometimes...
and whene you get the"bit cannot cast to fm" error make sure your minecraft/launcher isn't modded
my friends had the same problem and the host has fixed it
now i have this error and i just have to contact the host
maybe he can fix it ๐Ÿ˜‰

Hi,
I'm developing mc-server, an alternative C++ server for minecraft, and I believe I have found the cause of this issue.
The gist of it: if the server sends a 0x00 KeepAlive packet too soon, the client still has its netHandler set to NetHandlerLoginClient, which it tries to cast to NetHandlerPlayClient.

I added logging to the packet receiving routines and I've come up with this log:

[22:58:59] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.login.server.S01PacketEncryptionRequest, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:58:59] [Client thread/INFO]: Post-processing packet net.minecraft.network.login.server.S01PacketEncryptionRequest, NetHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Processing packet net.minecraft.network.login.server.S02PacketLoginSuccess directly, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Processing packet S02PacketLoginSuccess
[22:59:02] [Netty Client IO #6/INFO]: Processed packet S02PacketLoginSuccess
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S02PacketChat, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S02PacketChat, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S01PacketJoinGame, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S05PacketSpawnPosition, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S39PacketPlayerAbilities, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S03PacketTimeUpdate, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S30PacketWindowItems, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S06PacketUpdateHealth, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S1FPacketSetExperience, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S21PacketChunkData, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S21PacketChunkData, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Queueing packet net.minecraft.network.play.server.S08PacketPlayerPosLook, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Processing packet net.minecraft.network.play.server.S00PacketKeepAlive directly, netHandler is net.minecraft.client.network.NetHandlerLoginClient
[22:59:02] [Netty Client IO #6/INFO]: Processing packet S00PacketKeepAlive
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S02PacketChat, NetHandler is net.minecraft.client.network.NetHandlerPlayClient
[22:59:02] [Client thread/INFO]: [CHAT] ยง6Welcome to the Gallery server
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S02PacketChat, NetHandler is net.minecraft.client.network.NetHandlerPlayClient
[22:59:02] [Client thread/INFO]: [CHAT] ยง6Build what you want generated :)
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S01PacketJoinGame, NetHandler is net.minecraft.client.network.NetHandlerPlayClient
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S05PacketSpawnPosition, NetHandler is net.minecraft.client.network.NetHandlerPlayClient
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S39PacketPlayerAbilities, NetHandler is net.minecraft.client.network.NetHandlerPlayClient
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S03PacketTimeUpdate, NetHandler is net.minecraft.client.network.NetHandlerPlayClient
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S30PacketWindowItems, NetHandler is net.minecraft.client.network.NetHandlerPlayClient
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S06PacketUpdateHealth, NetHandler is net.minecraft.client.network.NetHandlerPlayClient
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S1FPacketSetExperience, NetHandler is net.minecraft.client.network.NetHandlerPlayClient
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S21PacketChunkData, NetHandler is net.minecraft.client.network.NetHandlerPlayClient
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S21PacketChunkData, NetHandler is net.minecraft.client.network.NetHandlerPlayClient
[22:59:02] [Client thread/INFO]: Post-processing packet net.minecraft.network.play.server.S08PacketPlayerPosLook, NetHandler is net.minecraft.client.network.NetHandlerPlayClient

Note that long after receiving the S02PacketLoginSuccess the netHandler class is still NetHandlerLoginClient; I believe this to be a race condition.

Also might be useful info, 1.7.9 seems to have the same problem, although with different obfuscated class names: "bll cannot be cast to fv"

Beware, the attached file (cheatengine.exe) is malware.

But Mattes D is it fixable?

I'm pretty sure it is. Almost everything is fixable, only the amount of effort required may be not adequate to the end effect. But this case should be on the easy side of things, and, googling the error message, I've seen this error pop up all over the internet, so I believe it's worth it.

Probably the easiest solution would be to make whichever packet is responsible for flipping the handler class a high-priority packet as well. Shouldn't affect much, since it's expected to be sent just once on game start, and it would make this error disappear perfectly.

billy nomikos

(Unassigned)

Unconfirmed

Minecraft 1.7.2, Minecraft 1.7.3, Minecraft 1.7.4

Retrieved