testcontainers / testcontainers/testcontainers-java

[Bug]: Switch docker-java transport to httpclient5 to avoid Java 24 warning

Open
#10,257 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type/bug
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Module

Core

Testcontainers version

1.20.6

Using the latest Testcontainers version?

Yes

Host OS

Win11 x64

Host Arch

x64

Docker version
Client:                                                                                                                                                                                   
 Version:           28.0.4                                                                                                                                                                
 API version:       1.48                                                                                                                                                                  
 Go version:        go1.23.7                                                                                                                                                              
 Git commit:        b8034c0                                                                                                                                                               
 Built:             Tue Mar 25 15:07:48 2025                                                                                                                                              
 OS/Arch:           windows/amd64                                                                                                                                                         
 Context:           desktop-linux                                                                                                                                                         
                                                                                                                                                                                          
Server: Docker Desktop 4.40.0 (187762)                                                                                                                                                    
 Engine:                                                                                                                                                                                  
  Version:          28.0.4                                                                                                                                                                
  API version:      1.48 (minimum version 1.24)                                                                                                                                           
  Go version:       go1.23.7                                                                                                                                                              
  Git commit:       6430e49                                                                                                                                                               
  Built:            Tue Mar 25 15:07:22 2025                                                                                                                                              
  OS/Arch:          linux/amd64                                                                                                                                                           
  Experimental:     false                                                                                                                                                                 
 containerd:                                                                                                                                                                              
  Version:          1.7.26                                                                                                                                                                
  GitCommit:        753481ec61c7c8955a23d6ff7bc8e4daed455734                                                                                                                              
 runc:                                                                                                                                                                                    
  Version:          1.2.5                                                                                                                                                                 
  GitCommit:        v1.2.5-0-g59923ef                                                                                                                                                     
 docker-init:                                                                                                                                                                             
  Version:          0.19.0                                                                                                                                                                
  GitCommit:        de40ad0
What happened?

When using Java 24, the JNA transitive dependency of the zerodep transport of docker-java produces the following message:

Short of requiring every user of testcontainers-java to add a JVM arg, there is no other option but to switch the docker-java transport to get rid of this warning. Httpclient5 would be a good candidate.

Relevant log output
WARNING: A restricted method in java.lang.System has been called                                                                                                                          
WARNING: java.lang.System::load has been called by com.sun.jna.Native in an unnamed module (file:/X:/gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/5.13.0/1200e7ebeedbe0d10062093f32925a912020e747/jna-5.13.0.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module                                                                                             
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
Additional Information

Contributor guide

Open the contributing guide

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.

Research direction

The issue identifies the Core module but no files or tests. Start by tracing the Core module's docker-java transport dependency and compare the proposed httpclient5 transport; done means Java 24 no longer emits the JNA restricted-access warning while the existing Core behavior remains working.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
backend, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.