Undertow ProxyHandler throws NullPointerException after updating
Issue
- We have an EAP undertow proxy set up and after updating we see an NPE like below:
java.lang.NullPointerException: Cannot invoke "java.net.InetAddress.getHostAddress()" because the return value of "java.net.InetSocketAddress.getAddress()" is null
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.handlers.proxy.ProxyHandler$ProxyAction.run(ProxyHandler.java:482)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.util.SameThreadExecutor.execute(SameThreadExecutor.java:35)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.HttpServerExchange.dispatch(HttpServerExchange.java:874)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.handlers.proxy.ProxyHandler$ProxyClientHandler.completed(ProxyHandler.java:345)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.handlers.proxy.ProxyHandler$ProxyClientHandler.completed(ProxyHandler.java:319)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.handlers.proxy.ProxyConnectionPool.connectionReady(ProxyConnectionPool.java:353)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.handlers.proxy.ProxyConnectionPool.connect(ProxyConnectionPool.java:548)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.handlers.proxy.mod_cluster.Context.handleRequest(Context.java:179)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.handlers.proxy.mod_cluster.ModClusterProxyClient.getConnection(ModClusterProxyClient.java:124)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.handlers.proxy.ProxyHandler$ProxyClientHandler.run(ProxyHandler.java:339)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.util.SameThreadExecutor.execute(SameThreadExecutor.java:35)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.Connectors.executeRootHandler(Connectors.java:412)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:265)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:162)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:100)
at io.undertow.core@2.2.37.SP2-redhat-00001//io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:57)
at org.jboss.xnio@3.8.16.Final-redhat-00001//org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
Environment
- JBoss Enterprise Application Platform (EAP)
- 7.4.20+
- 8.0 update 5+
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.