Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
2.2.7.Final
-
None
Description
All our WAR files have name with ## so Tomcat doesn't use version in the context name, for example,
server##1.0.war
It worked fine with Tomcat. We recently switched to Embedded Undertow with Spring Boot. The server throws following exception:
2021-09-05 12:04:53.341 ERROR 23052 — [ XNIO-1 I/O-1] io.undertow.request : UT005071: Undertow request failed HttpServerExchange{ GET /catalog-server} java.lang.RuntimeException: java.net.MalformedURLException: No !/ in spec 'file:/tmp/war/catalog-server'
Apparently, the war filename is not properly encoded and the # is treated as fragment and everything after # is dropped by URL class.
Here is the stack trace:
2021-09-05 12:04:53.341 ERROR 23052 --- [ XNIO-1 I/O-1] io.undertow.request : UT005071: Undertow request failed HttpServerExchange{ GET /catalog-server} java.lang.RuntimeException: java.net.MalformedURLException: No !/ in spec 'file:/tmp/war/catalog-server' at io.undertow.servlet.handlers.ServletPathMatches.getServletHandlerByPath(ServletPathMatches.java:126) at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:146) at io.undertow.server.handlers.HttpContinueReadHandler.handleRequest(HttpContinueReadHandler.java:69) at org.springframework.boot.web.embedded.undertow.DeploymentManagerHttpHandlerFactory$DeploymentManagerHandler.handleRequest(DeploymentManagerHttpHandlerFactory.java:75) at io.undertow.server.handlers.ProxyPeerAddressHandler.handleRequest(ProxyPeerAddressHandler.java:129) at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:104) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:387) at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:255) at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136) at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:162) at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:100) at io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:57) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:291) at org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:286) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) at org.xnio.nio.QueuedNioTcpServer2.acceptTask(QueuedNioTcpServer2.java:178) at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:612) at org.xnio.nio.WorkerThread.run(WorkerThread.java:479)Caused by: java.net.MalformedURLException: No !/ in spec 'file:/tmp/war/catalog-server' at java.base/java.net.URL.<init>(URL.java:661) at java.base/java.net.URL.<init>(URL.java:523) at java.base/java.net.URL.<init>(URL.java:470) at org.springframework.boot.web.embedded.undertow.JarResourceManager.getResource(JarResourceManager.java:51) at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory$LoaderHidingResourceManager.getResource(UndertowServletWebServerFactory.java:586) at org.springframework.boot.web.embedded.undertow.CompositeResourceManager.getResource(CompositeResourceManager.java:51) at io.undertow.servlet.handlers.ServletPathMatches.getServletHandlerByPath(ServletPathMatches.java:96)