You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmmm... I'm wondering, since DT is distributed as self-contained JAR file, what's the benefit of keeping the servlet container running if the application failed to start?
I actually run it on a standalone Tomcat server in my dev environment.
In general it should be enough to throw an unchecked dependency to stop the embedded container from starting. This is what the other ServletContainerListeners are doing:
if (Runtime.getRuntime().availableProcessors() < 2) {
if (systemRequirementCheckEnabled) {
setFailedValidation(true);
finalStringmessage = "Dependency-Track requires a minimum of 2 CPU cores. Cannot continue. To fix, specify -Xmx4G (or higher) when executing Java.";
LOGGER.error(message);
thrownewRequirementsException(message);
} else {
finalStringmessage = "Dependency-Track requires a minimum of 2 CPU cores. We highly recommand to use 2 CPU cores. Dependency-Track will continue to start, but may not function properly. https://docs.dependencytrack.org/getting-started/deploy-docker/#container-requirements-api-server";
Current Behavior
UpgradeInitializer
immediately terminates the entire Servlet Container if the connection to the database fails, by usingRuntime.halt()
:dependency-track/src/main/java/org/dependencytrack/upgrade/UpgradeInitializer.java
Lines 63 to 79 in ba0f375
Steps to Reproduce
application.properties
with an error in the database credentials.Expected Behavior
I would expect UpgradeInitializer to throw an exception that will stop DependencyTrack from starting, but leave the Servlet Container running.
Dependency-Track Version
4.12.6
Dependency-Track Distribution
Executable WAR
Database Server
N/A
Database Server Version
15
Browser
N/A
Checklist
The text was updated successfully, but these errors were encountered: