(Noted when updating documentation in r1632965) The method javax.websocket.RemoteEndpoint.Basic.sendObject(Object) is expected to throw EncodeException if there is no suitable encoder configured for the object type. The actual implementation in org.apache.tomcat.websocket.WsRemoteEndpointBasic.sendObject(Object) does not throw that exception, because the method that is called there does not throw it. It is not even declares a "throws" for it, and it is a checked exception. My understanding is that the exception is passed to a competition handler, but it is not properly unwrapped. An IOException is thrown instead.
This has been fixed in 8.0.x for 8.0.15 onwards and in 7.0.x for 7.0.57 onwards.