Summary
EmbeddedDirectoryServer.setup() always fails in a fresh JVM with:
java.lang.IllegalStateException: Time service not started
at org.opends.server.util.TimeThread.checkState(TimeThread.java:410)
at org.opends.server.util.TimeThread.getLocalTime(TimeThread.java:275)
at org.opends.server.loggers.TextErrorLogPublisher.log(TextErrorLogPublisher.java:458)
at org.opends.server.loggers.ErrorLogger.log(ErrorLogger.java:101)
...
at org.opends.quicksetup.TempLogFile.<init>(TempLogFile.java:88)
at org.forgerock.opendj.server.embedded.EmbeddedDirectoryServer.setup(EmbeddedDirectoryServer.java:423)
The failure happens before the installer (InstallDS) is even launched.
Root cause
TempLogFile registers a TextErrorLogPublisher to capture setup messages into the temporary log file and immediately logs through it. The publisher formats its timestamp with TimeThread.getLocalTime(), which throws when the time service is not running — and that is the normal state at setup() time:
- in a fresh JVM (the main embedded use case) nothing has started the time service yet;
- in a JVM where an in-process server was stopped, the service has been shut down.
How it was found
Running the slow TestNG group (excluded from CI): EmbeddedDirectoryServerTestCase.testSetupFromArchive fails with the exception above.
Expected behaviour
EmbeddedDirectoryServer.setup() works in a fresh JVM without requiring the caller to start any server-internal services first; log publishers used during setup must not depend on the running time service.
Summary
EmbeddedDirectoryServer.setup()always fails in a fresh JVM with:The failure happens before the installer (
InstallDS) is even launched.Root cause
TempLogFileregisters aTextErrorLogPublisherto capture setup messages into the temporary log file and immediately logs through it. The publisher formats its timestamp withTimeThread.getLocalTime(), which throws when the time service is not running — and that is the normal state atsetup()time:How it was found
Running the
slowTestNG group (excluded from CI):EmbeddedDirectoryServerTestCase.testSetupFromArchivefails with the exception above.Expected behaviour
EmbeddedDirectoryServer.setup()works in a fresh JVM without requiring the caller to start any server-internal services first; log publishers used during setup must not depend on the running time service.