java.lang.UnsupportedClassVersionError: ... has been compiled by a more recent version of the Java Runtime
(class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Cause: Java version mismatch. Your WildFly/EAP version requires a newer Java.
Solution: The framework should auto-detect this, but if you see this error:
-
Check your ZIP file name matches expected format:
- ✅
wildfly-31.0.1.Final.zip - ✅
jboss-eap-8.0.0.zip - ❌
wildfly.zip(missing version) - ❌
my-custom-wildfly-build.zip(non-standard name)
- ✅
-
If using custom ZIP names, set Java version manually in the Dockerfile
Java Version Requirements:
- WildFly 27+: Java 17
- EAP 8+: Java 17
Cause: Container failed to start, check logs for actual error.
Solution:
# Find the container
docker ps -a | grep wildfly
# Check logs
docker logs <container-id>
# Common issues in logs:
# - Java version mismatch (see above)
# - Port conflicts
# - Memory issues
# - Configuration errorsCause: Container started but WildFly didn't finish booting in time.
Solutions:
-
Increase timeout (if your system is slow):
// In WildFlyContainer.java or BalancerContainer.java .withStartupTimeout(Duration.ofMinutes(10)) // Default is 5
-
Check Docker resources:
docker stats # Ensure enough memory -
Check for actual errors:
docker logs <container-id> | grep -i error
java.io.IOException: Broken pipe (SIGPIPE)
Error when copying TAR file entry: wildfly-39.0.1.Final.zip
java.io.IOException: Pipe closed
Cause: Docker daemon closes connection when Testcontainers tries to transfer very large ZIP files (300MB+).
Solution: ✅ Already implemented!
The framework now uses direct docker build instead of Testcontainers' file transfer:
-
First run: Builds image using
docker builddirectlyINFO - Building WildFly image from ZIP: wildfly-39.0.1.Final.zip Running: docker build -t modcluster-test/wildfly-39-0-1-final:openjdk-17 -
Subsequent runs: Reuses the built image
INFO - Using existing image: modcluster-test/wildfly-39-0-1-final:openjdk-17
Manual cleanup (if needed):
# List built images
docker images | grep modcluster-test
# Remove if you want to rebuild
docker rmi modcluster-test/wildfly-39-0-1-final:openjdk-17Benefits:
- ✅ Works with any size ZIP file
- ✅ Image is cached between test runs
- ✅ Same image used for both balancer and workers (efficient!)
- ✅ No Testcontainers transfer size limits
Cause: Docker ran out of disk space.
Solutions:
# Check disk usage
docker system df
# Clean up unused images/containers
docker system prune -a
# Clean up build cache
docker builder prune -a
# On Linux, check Docker's data root
df -h /var/lib/dockerCause: Docker not running or permission issues.
Solutions:
-
Start Docker:
# Linux sudo systemctl start docker # Mac/Windows # Start Docker Desktop
-
Fix permissions (Linux):
sudo usermod -aG docker $USER newgrp docker # Or logout and login again
-
Check Docker socket:
ls -la /var/run/docker.sock # Should be writable by your user or docker group
Cause: Balancer not fully started or network issues.
Solutions:
-
Check balancer logs:
// In your test, add: String logs = cluster.getBalancer().getContainer().getLogs(); System.out.println(logs);
-
Verify network:
docker network ls docker network inspect <network-id>
-
Check port mappings:
docker ps # Verify ports are mapped correctly
Possible causes:
-
Container reuse enabled in CI:
# Disable for CI mvn test -Dtestcontainers.reuse.enable=false
-
Timing issues:
// Use Awaitility for async operations await().atMost(30, SECONDS) .pollInterval(2, SECONDS) .untilAsserted(() -> { // your assertion });
-
Resource constraints:
# Increase Docker memory to 6GB+ # Reduce parallel test execution mvn test -DforkCount=1
Cause: Missing assertAll() call.
Solution: The test extension handles this automatically, but verify:
@ExtendWith({ModClusterTestExtension.class, SoftAssertionsExtension.class})
public class MyTest {
@InjectSoftAssertions // ← Make sure this is present
private SoftAssertions softly;
// softly.assertAll() is called automatically in @AfterEach
}Expected behavior:
- First run: 3-5 minutes (building images)
- Subsequent runs: 1-2 minutes (cached)
If slower:
-
Check Docker resources:
docker stats # CPU should be < 80% # Memory should have 2GB+ free
-
Check disk I/O:
iostat -x 2 # Look for high await times -
Enable container reuse (dev only):
# src/test/resources/testcontainers.properties testcontainers.reuse.enable=true
See PERFORMANCE.md for detailed optimization guide.
Symptoms:
INFO - No ZIP provided, using pre-built container image
Solutions:
-
Check file location:
ls -la distributions/*.zip -
Verify file name format:
# Must start with "wildfly-" or "jboss-eap-" mv my-wildfly.zip wildfly-31.0.1.Final.zip -
Use explicit path:
mvn test -Dwildfly.zip.path=/full/path/to/wildfly-31.0.1.Final.zip
Symptoms:
Error extracting ZIP
unzip: invalid zip file
Solutions:
-
Verify ZIP integrity:
unzip -t distributions/wildfly-31.0.1.Final.zip
-
Re-download if corrupted:
rm distributions/wildfly-31.0.1.Final.zip # Download again from https://wildfly.org -
Check file permissions:
chmod 644 distributions/wildfly-31.0.1.Final.zip
Symptoms:
No route to host
Connection refused to balancer:8090
Solutions:
-
Check network creation:
docker network ls # Should see testcontainers network -
Verify network aliases:
docker network inspect <network-id> # Should show "balancer" alias
-
Check firewall (Linux):
sudo firewall-cmd --list-all # Docker should be in trusted zone
Cause: Using internal URL instead of mapped port.
Solution:
// ❌ Wrong - internal URL
String url = "http://balancer:8080";
// ✅ Correct - mapped port
String url = cluster.getBalancer().getHttpUrl();Solution:
# Enable Podman socket
systemctl --user enable --now podman.socket
# Set environment
export DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock
# Verify
curl -H "Content-Type: application/json" \
--unix-socket /run/user/$(id -u)/podman/podman.sock \
http://localhost/_pingSolution:
# Create Docker socket symlink
sudo ln -s /run/user/$(id -u)/podman/podman.sock /var/run/docker.sock
# Or set DOCKER_HOST
export DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock
export TESTCONTAINERS_RYUK_DISABLED=true # If ryuk fails with PodmanCommon causes:
-
Container reuse (should be disabled in CI):
// In Jenkinsfile sh 'mvn test -Dtestcontainers.reuse.enable=false'
-
Docker socket permissions:
// Add Jenkins user to docker group sh 'sudo usermod -aG docker jenkins'
-
Resource limits:
// Increase memory in Jenkinsfile options { timeout(time: 2, HOURS) }
Solution:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Start Docker
run: |
sudo systemctl start docker
sudo chmod 666 /var/run/docker.sock
- name: Run tests
run: mvn testWhen troubleshooting, check in this order:
-
✅ Docker running?
docker ps
-
✅ Enough resources?
docker stats free -h
-
✅ ZIP file present and valid?
ls -lh distributions/ unzip -t distributions/*.zip -
✅ Container logs?
docker ps -a docker logs <container-id>
-
✅ Java version correct?
# Check logs for "requires openjdk-XX" # Should match your WildFly/EAP version
-
✅ Network connectivity?
docker network inspect <network-id>
-
✅ Test logs?
cat target/surefire-reports/*.txt
# Maven debug mode
mvn test -X
# More verbose test output
mvn test -Dsurefire.printSummary=true// In your test
@Test
public void debug(TestCluster cluster) {
cluster.startWorkers(1);
// Get container logs
String balancerLogs = cluster.getBalancer().getContainer().getLogs();
String workerLogs = cluster.getWorker1().getContainer().getLogs();
System.out.println("=== Balancer Logs ===");
System.out.println(balancerLogs);
System.out.println("=== Worker Logs ===");
System.out.println(workerLogs);
}# In container logs
grep -i "error" logs.txt
grep -i "exception" logs.txt
grep -i "failed" logs.txt
grep -i "WFLYSRV0025" logs.txt # Server started message
grep -i "java.lang" logs.txt # Java errors
# In test output
grep "Failures:" target/surefire-reports/*.txt
grep "Errors:" target/surefire-reports/*.txtIf none of the above helps:
- Create a minimal reproducible test case
- Capture full logs (Maven -X, Docker logs)
- Note your environment (OS, Docker version, Java version)
- Check if issue occurs with pre-built images (no ZIP)
- Try with a different WildFly/EAP version
Example bug report template:
**Environment**:
- OS: Fedora 39
- Docker: 24.0.5
- Java: OpenJDK 17
- Maven: 3.9.1
**WildFly Version**:
- wildfly-31.0.1.Final.zip (auto-detected Java 17)
**Steps to Reproduce**:
1. Place ZIP in distributions/
2. Run: mvn test -Dtest=MyTest
**Expected**: Test passes
**Actual**: Container exits with code 1
**Logs**: [attach docker logs and test output]