Play Framework 2.5 JavaAsync throwing CompletionException

You have to supply the HTTP execution context when dealing with CompletableFuture / CompletionStage. In Scala the context information is passed via implicits, these are not available in Java - this is why Play uses ThreadLocal.

However you can lose this information when switching threads and that is why you have the problem. You may think that you don't access the HTTP context but actually you do - you are using request().

So you have to change your code to use supplyAsync with an Executor:

https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html#supplyAsync-java.util.function.Supplier-java.util.concurrent.Executor-

From this:

CompletableFuture.supplyAsync(() -> abstractSource.getChunked(index.render(CSRF.getToken(request()).map(t -> 
                                                    t.value()).orElse("no token")).body()
                                                   )
                                                );

to this:

CompletableFuture.supplyAsync(() -> abstractSource.getChunked(index.render(CSRF.getToken(request()).map(t -> 
                                                    t.value()).orElse("no token")).body()
                                                   )
                                                , ec.current());

where ec is your context: @Inject HttpExecutionContext ec;