NullPointerException can happen on the range request in EAP 7

Solution Verified - Updated -

Issue

The following NullPointerException can happen on the request having Range request header in EAP 7:

ERROR [io.undertow.request] (default task-1) UT005071: Undertow request failed HttpServerExchange{ GET /test.txt}: java.lang.NullPointerException
    at io.undertow.server.handlers.resource.PathResource$1ServerTask.run(PathResource.java:156)
    at io.undertow.server.handlers.resource.PathResource$1ServerTask.onComplete(PathResource.java:200)
    at io.undertow.io.AsyncSenderImpl.invokeOnComplete(AsyncSenderImpl.java:413)
    at io.undertow.io.AsyncSenderImpl.send(AsyncSenderImpl.java:173)
    at io.undertow.server.handlers.resource.PathResource$1ServerTask.run(PathResource.java:187)
    at io.undertow.server.handlers.resource.PathResource.serveImpl(PathResource.java:256)
    at io.undertow.server.handlers.resource.PathResource.serveRange(PathResource.java:118)
    at io.undertow.server.handlers.resource.ResourceHandler$1.handleRequest(ResourceHandler.java:335)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1349)
    at java.lang.Thread.run(Thread.java:748)

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content