More than one Servlet Mapping defined || Storing non-serializable bean

Hello everyone, i encountered these warnings when I run my application. I wanted to know why and, if possible, how I can fix it.

thanks in advance.

WARN 33672 — [nio-8080-exec-1] c.v.spring.navigator.SpringViewProvider : No SpringViews found
WARN 33672 — [nio-8080-exec-1] com.vaadin.spring.internal.BeanStore : Storing non-serializable bean [io.jmix.ui.sys.ScreensImpl@678cfb1c] with name [ui_Screens] in [UIBeanStore[id=2716fdaf, name=UI:0]]
WARN 33672 — [nio-8080-exec-1] com.vaadin.spring.internal.BeanStore : Storing non-serializable bean [io.jmix.ui.navigation.WebUrlRouting@7cf233a3] with name [ui_UrlRouting] in [UIBeanStore[id=2716fdaf, name=UI:0]]
WARN 33672 — [nio-8080-exec-1] com.vaadin.spring.internal.BeanStore : Storing non-serializable bean [io.jmix.ui.JmixApp@ae4410d] with name [ui_App] in [SessionAwareBeanStore[id=46441547, name=Session:9AFDE398C4FBD0B60B47CEFA081D33AE]]
WARN 33672 — [nio-8080-exec-1] com.vaadin.spring.internal.BeanStore : Storing non-serializable bean [io.jmix.ui.exception.FileStorageExceptionHandler@5f5fc032] with name [ui_FileStorageExceptionHandler] in [UIBeanStore[id=2716fdaf, name=UI:0]]
INFO 33672 — [nio-8080-exec-1] io.jmix.ui.WindowConfig : WindowConfig initialized in 700 ms
WARN 33672 — [nio-8080-exec-1] com.vaadin.spring.internal.BeanStore : Storing non-serializable bean [io.jmix.ui.sys.DialogsImpl@106a4170] with name [ui_Dialogs] in [UIBeanStore[id=2716fdaf, name=UI:0]]
WARN 33672 — [nio-8080-exec-1] com.vaadin.spring.internal.BeanStore : Storing non-serializable bean [io.jmix.ui.sys.NotificationsImpl@7a0542c7] with name [ui_Notifications] in [UIBeanStore[id=2716fdaf, name=UI:0]]
WARN 33672 — [nio-8080-exec-1] com.vaadin.spring.internal.BeanStore : Storing non-serializable bean [io.jmix.ui.sys.FragmentsImpl@7323a53a] with name [ui_Fragments] in [UIBeanStore[id=2716fdaf, name=UI:0]]
WARN 33672 — [nio-8080-exec-1] com.vaadin.spring.internal.BeanStore : Storing non-serializable bean [io.jmix.ui.sys.WebBrowserToolsImpl@20f00dda] with name [ui_WebBrowserTools] in [UIBeanStore[id=2716fdaf, name=UI:0]]
WARN 33672 — [nio-8080-exec-1] com.vaadin.spring.internal.BeanStore : Storing non-serializable bean [io.jmix.ui.navigation.WebHistory@4a141f10] with name [ui_History] in [UIBeanStore[id=2716fdaf, name=UI:0]]
WARN 33672 — [nio-8080-exec-1] com.vaadin.spring.internal.BeanStore : Storing non-serializable bean [io.jmix.ui.navigation.UrlChangeHandler@69a9b0a1] with name [ui_UrlChangeHandler] in [UIBeanStore[id=2716fdaf, name=UI:0]]
WARN 33672 — [nio-8080-exec-2] org.atmosphere.util.IOUtils : More than one Servlet Mapping defined. WebSocket may not work org.apache.catalina.core.ApplicationServletRegistration@3d47d17d
WARN 1 — [nio-8080-exec-8] org.atmosphere.util.IOUtils : More than one Servlet Mapping defined. WebSocket may not work org.apache.catalina.core.ApplicationServletRegistration@5a834869
WARN 1 — [nio-8080-exec-3] org.atmosphere.util.IOUtils : More than one Servlet Mapping defined. WebSocket may not work org.apache.catalina.core.ApplicationServletRegistration@1d022d82
WARN 1 — [nio-8080-exec-2] org.atmosphere.util.IOUtils : More than one Servlet Mapping defined. WebSocket may not work org.apache.catalina.core.ApplicationServletRegistration@282a67eb

Hi,

Thank you for noticing, I’ve created a GitHub issue. Warnings themself are harmless.

Regards,
Gleb

@gorelov @krivopustov
Hello guys, I dont think that it is harmless.
It is OK in DEV. No problem ever.

But in PROD on AWS EC2 AL2023 instance the problems begun… :face_with_raised_eyebrow:

At the same monment:

UI:

Communication problem
Pay attention to any unsaved data, and click here to continue.
Invalid JSON from server: 1|X

WebDeveloper Tools Console in Edge:

vaadinPush.js?v=8.14.3-4-jmix:1  Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent). - wasClean: false
log @ vaadinPush.js?v=8.14.3-4-jmix:1
warn @ vaadinPush.js?v=8.14.3-4-jmix:1
ax.onclose @ vaadinPush.js?v=8.14.3-4-jmix:1

appliation log on server:

2024-02-07 20:30:15.312 WARN 61047 — [nio-8080-exec-7] org.atmosphere.util.IOUtils : More than one Servlet Mapping defined. WebSocket may not work org.apache.catalina.core.ApplicationServletRegistration@fda1a7a

image

Firefox says HTTP 101:

image

image

Maybe: /vaadinServlet

2024-02-07 23:25:47.906 DEBUG 75392 --- [           main] org.atmosphere.cpr.AtmosphereFramework   : Scanning all classes on the classpath
2024-02-07 23:25:47.908 TRACE 75392 --- [           main] o.a.cpr.DefaultBroadcasterFactory        : About to create /*
2024-02-07 23:25:47.909 TRACE 75392 --- [           main] o.a.cpr.DefaultBroadcasterFactory        : Looking in the store using /* returned null
2024-02-07 23:25:47.912 TRACE 75392 --- [           main] org.atmosphere.util.ExecutorsFactory     : Max number of DispatchOp Unlimited
2024-02-07 23:25:47.914  INFO 75392 --- [           main] org.atmosphere.util.ForkJoinPool         : Using ForkJoinPool  java.util.concurrent.ForkJoinPool. Set the org.atmosphere.cpr.broadcaster.maxAsyncWriteThreads to -1 to fully use its power.
2024-02-07 23:25:47.914 TRACE 75392 --- [           main] org.atmosphere.util.ExecutorsFactory     : Max number of AsyncOp 200
2024-02-07 23:25:47.915 TRACE 75392 --- [           main] org.atmosphere.util.ExecutorsFactory     : Max number of Atmosphere-Scheduler 16
2024-02-07 23:25:47.918 TRACE 75392 --- [           main] o.a.cpr.DefaultBroadcasterFactory        : Broadcaster /* was created 
	Name: /*
	AtmosphereResource: 0
	BroadcasterCache org.atmosphere.cache.UUIDBroadcasterCache
2024-02-07 23:25:47.918 TRACE 75392 --- [           main] o.atmosphere.lifecycle.LifecycleHandler  : /* new lifecycle policy: NEVER
2024-02-07 23:25:47.920  INFO 75392 --- [           main] org.atmosphere.cpr.AtmosphereFramework   : Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol 
2024-02-07 23:25:47.921 DEBUG 75392 --- [           main] o.a.cpr.DefaultAsyncSupportResolver      : Found javax.servlet.AsyncListener
2024-02-07 23:25:47.921 DEBUG 75392 --- [           main] o.a.cpr.DefaultAsyncSupportResolver      : Found javax.websocket.Endpoint
2024-02-07 23:25:47.924 TRACE 75392 --- [           main] o.a.container.JSR356AsyncSupport         : JSR356 Path mapping Size 5
2024-02-07 23:25:47.924  WARN 75392 --- [           main] org.atmosphere.util.IOUtils              : More than one Servlet Mapping defined. WebSocket may not work org.apache.catalina.core.ApplicationServletRegistration@26020a41
2024-02-07 23:25:47.924  INFO 75392 --- [           main] o.a.container.JSR356AsyncSupport         : JSR 356 Mapping path /vaadinServlet
2024-02-07 23:25:47.933  INFO 75392 --- [           main] org.atmosphere.cpr.AtmosphereFramework   : Installing Default AtmosphereInterceptors

This is interesting:

Quote:

This warning is there for a purpose. In 90%+ cases it is something that you do not need worry about. In case you have complex application with multiple UIs, you need to pay attention to this. E.g. which is your primary one to give Websocket and which is the secondary one ok to use Long Polling. I would assume that in some cases developers are given requirements like no “WARN” should be in the log, when having this logging is a bit conflicting with that. On the other hand if this logging would be “INFO” or “DEBUG” it wont be noticed as easily and wont help developers to configure their application correctly. Moreover this logging is not done by Vaadin, but Atmosphere here https://github.com/vaadin/atmosphere/blob/master/modules/runtime/src/main/java/org/atmosphere/util/IOUtils.java#L283 and is still there in its current version. It is there as Atmosphere can support Websocket only with one servlet mapping at the time