Files
llm-wiki/raw/errors/slim-jre-random-generator-missing-2026-06-24.md
T

70 lines
3.7 KiB
Markdown

---
title: error / slim JRE random generator provider missing (2026-06-24)
source_type: error-note
status: raw
related_branches: [feature-developer-experience-contract]
related_projects: [ca-skeleton]
tags: [error, ca-skeleton, runtime, java-21, docker]
created: 2026-06-24
status_label: resolved
---
# error: slim-jre-random-generator-missing
## Parent / 부모
- [[raw/branch-notes/feature-developer-experience-contract]]
## 증상 / Symptom
- 에러 메시지 (원문 그대로):
```text
Caused by: java.lang.IllegalArgumentException: No implementation of the random number generator algorithm "L32X64MixRandom" is available
```
- 발생 컨텍스트: `bootstrapMigrateAndStart`에서 Temurin 21 JRE image의 application context 생성.
- 발생 시점: 2026-06-24
- 발생 환경: local Docker, `eclipse-temurin:21-jre-jammy` runtime stage.
- 재현 가능 여부: `always` — 해당 runtime image에서 `RandomGenerator.getDefault()` 호출.
## 재현 절차 / Reproduction
1. 기존 코드가 `OutboxConfig`에서 `RandomGenerator.getDefault()`를 호출하는 app image를 빌드한다.
2. base/local Compose로 app을 기동한다.
3. Flyway는 성공하지만 `outboxRelayScheduler` bean 생성에서 context가 종료되고 container가 unhealthy가 된다.
## 조사 단계 / Investigation log
- 2026-06-24 — Docker health history 확인 → connection refused로 app port가 열리지 않음.
- 2026-06-24 — app logs 확인 → Flyway 3개 migration은 성공했고 이후 `outboxRelayScheduler` 생성에서 예외 발생.
- 2026-06-24 — stack trace 역추적 → `OutboxConfig.outboxRelayScheduler`의 `RandomGenerator.getDefault()`가 `L32X64MixRandom` provider를 선택하지만 runtime에서 provider를 찾지 못함.
- 2026-06-24 — 최소 회귀 테스트 작성 → composition root RNG bean이 `java.base` module 구현이어야 한다는 테스트를 먼저 compile RED로 확인.
## 근본 원인 / Root cause
- 직접 원인: default RNG provider lookup이 runtime image에서 사용 불가능한 알고리즘을 선택했다.
- 근본 원인: full local JDK test만으로는 slim JRE runtime module/provider 차이를 검증하지 못했다.
- 트리거 조건: `RandomGenerator.getDefault()`를 slim JRE container에서 application startup 중 호출.
## Sources / 근거
- [[raw/branch-notes/feature-developer-experience-contract]] D3 — 실제 container startup/smoke를 bootstrap에 포함한 결정.
- local stack trace + `OutboxConfigTest` RED/GREEN evidence. 외부 공식 자료 조회는 web 403으로 차단되어 `UNSUPPORTED_DECISION` 경계를 유지한다.
## 해결 / Resolution
- 적용한 조치: composition root에 `SplittableRandom` 기반 `RandomGenerator` bean을 등록하고 `OutboxBackoffPolicy`에 주입.
- 검증 방법: bean implementation module이 `java.base`인지 focused test, 전체 `test check`, 실제 `./gradlew bootstrap`의 container health/HTTP smoke로 확인.
- 잔여 위험 / 후속 작업: 다른 runtime-only provider lookup도 container smoke 없이는 같은 종류의 gap이 남을 수 있다.
## 회고 / Lessons
- 빨리 감지하는 신호: host test green 뒤 container startup에서 `No implementation ... algorithm`이 나오면 JDK/JRE module/provider parity를 확인한다.
- 예방 체크리스트 항목 후보: release runtime image로 application context와 health endpoint를 실제 기동한다.
- wiki로 끌어올릴 가치가 있는 일반화된 교훈: full JDK unit test와 slim JRE runtime parity는 별도 검증 대상이다.
## Related / 관련
- [[raw/errors/bootstrap-postgres-port-collision-2026-06-24]]
- [[raw/interviews/single-command-local-bootstrap]]
- [[raw/blog-topics/five-stage-local-bootstrap-contract-2026-06-24]]