`NoSuchElementException` from `ServiceLoader` in Async Context
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
- Domain
- api, backend, networking
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.NoSuchElementExceptionoriginating fromjava.util.ServiceLoaderand traced up throughorg.eclipse.jetty.websocket.api.ExtensionConfig.getParser. - Cause: The
ServiceLoaderrelies on theThread.currentThread().getContextClassLoader(). When the initialization code runs on a worker thread from a thread pool (likeForkJoinPool), 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 aCompletableFuture.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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from binance/binance-connector-java
-
Jetty versionOpen
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
binance/binance-connector-java#239 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in binance/binance-connector-java
Similar issues
-
Clock.MakeTime fails to validate hour, minute, and second ranges due to inert Calendar.set try-catchOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
mit-cml/appinventor-sources#4139 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Vakore/ZappierGames#81 ·
-
proposal
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
beemdevelopment/Aegis#1843 · 1 reaction ·
-
[Bug] Logo style setting missing and `classic` style not applied across multiple platforms (v3.1.0)Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Stirling-Tools/Stirling-PDF#8382 · 1 reaction ·
Maintainers usually reply within 2 days
-
>enhancement needs:triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
elastic/elasticsearch#161191 ·
Maintainers usually reply within 1 day