Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`NoSuchElementException` from `ServiceLoader` in Async Context

Open
#166 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
28/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java

Research direction

Start by tracing DerivativesTradingUsdsFuturesWebSocketStreams when it is created inside CompletableFuture.supplyAsync(), then inspect ServiceLoader and org.eclipse.jetty.websocket.api.ExtensionConfig.getParser in the reported Play/Pekko context. Reproduce the failure on a ForkJoinPool worker and confirm how the context classloader differs; the report does not define the expected fix or a completion test.

Written by the indexing model from the issue text.

Description

This report details a critical runtime exception encountered for derivatives trading (USDS Futures) within a Play Framework 3 / Pekko environment.

When initializing the WebSocket client within a CompletableFuture (e.g., on Play's default ForkJoinPool), the ServiceLoader mechanism fails to find Jetty WebSocket extension implementations.

  • Error: java.util.NoSuchElementException originating from java.util.ServiceLoader and traced up through org.eclipse.jetty.websocket.api.ExtensionConfig.getParser.
  • Cause: The ServiceLoader relies on the Thread.currentThread().getContextClassLoader(). When the initialization code runs on a worker thread from a thread pool (like ForkJoinPool), this context classloader may not have visibility of the full application dependency classpath where the Jetty service implementations reside.
  • Trigger: Instantiating new DerivativesTradingUsdsFuturesWebSocketStreams(wsConnectionPool) inside a CompletableFuture.supplyAsync() block.
Dominant language
Java
Stars
580
Forks
258
Avg merge
30m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from binance/binance-connector-java

All issues in binance/binance-connector-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.