This example of WebSocket de-/encoders won't work in WildFly. I get this exception:
javax.websocket.DeploymentException: UT003029: Could not find message parameter on method public void SomeClass.someMethod(SomeMessageType)
As far as I can tell, this is due to a wrong/different implementation in Undertow. Apparently, other application servers handle these cases differently (though I did not test that!), because the tutorial linked above would not exist otherwise.
The problem is the way of determining the type that a de-/encoder handles. In order to do that, Undertow uses the parameter type of the first parameter of the encode/decode method:
That won't work if that parameter is generic, because type erasure will turn it into "Object", so that there are plenty of de-/encoders for "Object" registered in the EncodingFactory, but none for the types I need.
The Tyrus reference implementation on the other hand uses a complicated method to retrieve the value from the generic type parameter:
This issue is similar to