Skip to content

fix: add lib/ to collector and server CLASSPATH in entrypoint.sh#4190

Open
orangeCatDeveloper wants to merge 1 commit into
apache:masterfrom
orangeCatDeveloper:fix/issue-3296-collector-classpath
Open

fix: add lib/ to collector and server CLASSPATH in entrypoint.sh#4190
orangeCatDeveloper wants to merge 1 commit into
apache:masterfrom
orangeCatDeveloper:fix/issue-3296-collector-classpath

Conversation

@orangeCatDeveloper

@orangeCatDeveloper orangeCatDeveloper commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

Starting the collector or server from the packaged tarball (via Docker or bin/entrypoint.sh directly) crashes on boot:

NoClassDefFoundError: org/springframework/boot/SpringApplication

Why

The app jar is "thin" — its actual dependencies (Spring, etc.) live in a separate lib/ folder next to it. entrypoint.sh builds the Java classpath by hand, but forgot to include lib/, so none of those dependency jars were ever loaded.

Fix

Add lib/* to the classpath in entrypoint.sh, for both collector and server.

Tested

Built a real image, ran it with the old script — got the exact crash above (matches what was reported in #3296). Swapped in the fixed script — starts up cleanly, Tomcat comes up, collector registers all its protocols.

Fixes #3296

The JVM collector and server are packaged as a thin jar plus a
separate lib/ directory of dependencies (maven-jar-plugin
classpathPrefix=lib/, assembly dependencySet outputDirectory=lib).
entrypoint.sh launches with `java -cp $CLASSPATH $MAIN_CLASS`, which
ignores the jar's manifest Class-Path entirely (that's only honored
with `java -jar`), so every dependency jar in lib/ was silently
excluded from the classpath. Any real deployment via the Docker image
or the bin/entrypoint.sh script crashes on startup:

  Exception in thread "main" java.lang.NoClassDefFoundError:
    org/springframework/boot/SpringApplication

Add lib/* to CLASSPATH alongside the jar and ext-lib.

Fixes apache#3296
@orangeCatDeveloper orangeCatDeveloper force-pushed the fix/issue-3296-collector-classpath branch from e05b26b to 61852ea Compare July 9, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant