5

In my SpringBoot application logs I see the following WARNs:

UT026009: XNIO worker was not set on WebSocketDeploymentInfo, the default worker will be used
UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used

From a Google search it seems they could be related to Undertow suggesting for an improvement which seems to be impossible to be implemented.

Does anyone have any further clarifications on these, and maybe a suggestion on how to make the logs disappear since the application runs just fine?

FleaLes
  • 127
  • 1
  • 10

3 Answers3

4

It is a heads up for configuration of buff pool and does not effect in using.

As suggested from https://blog.csdn.net/weixin_39841589/article/details/90582354,

@Component
public class CustomizationBean implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> {
 
    @Override
    public void customize(UndertowServletWebServerFactory factory) {
        factory.addDeploymentInfoCustomizers(deploymentInfo -> {
            WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo();
            webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(false, 1024));
            deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo);
        });
    }
}
Sergey
  • 3,253
  • 2
  • 33
  • 55
Sean Sun
  • 496
  • 1
  • 4
  • 14
  • 1
    It's a pity that you have to add this boilerplate just to get rid of an irrelevant warning. – Inego Dec 20 '21 at 03:48
  • 1
    Almost 2 years later it's still a problem. – Archimedes Trajano Mar 10 '22 at 00:05
  • Thank you guy, I'm a WARN's allergic. This helps so much. ;) I have changed a little detail, to meet my configs organization, so I get: ``` @Configuration public class UndertowConfig implements WebServerFactoryCustomizer { ... } ``` Thanks! – rodrix Apr 27 '22 at 15:29
2

exclusion undertow-websockets

<exclusion><artifactId>undertow-websockets-jsr</artifactId><groupId>io.undertow</groupId></exclusion>
Ryan M
  • 18,333
  • 31
  • 67
  • 74
黄祖祥
  • 21
  • 2
  • 3
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 30 '22 at 09:14
  • 3
    While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. – Yunnosch Jun 16 '22 at 05:03
2

If not using WebSocket in Undertow on SpringBoot.

implementation ("org.springframework.boot:spring-boot-starter-undertow") {
    exclude group: "io.undertow", module: "undertow-websockets-jsr"
}
Rick Luan
  • 21
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 25 '22 at 06:56