So I'm trying to test a local build of 4.2 branch ...
# dev
c
So I'm trying to test a local build of 4.2 branch of pulsar (we are currently on 4.1.2) to validate our threading fix and we're crashing on startup. Details in ๐Ÿงต
Copy code
2026-06-01T19:52:13,147+0000 [main] INFO  org.apache.bookkeeper.server.Main - Using configuration file /pulsar/conf/bookkeeper.conf
2026-06-01T19:52:13,162+0000 [main] INFO  org.apache.bookkeeper.server.Main - Hello, I'm your bookie, bookieId is <not-set>, listening on port 3181. Metadata service uri is <zk+hierarchical://pulsar-zookeeper:2181/ledgers>. Journals are in [/pulsar/data/bookkeeper/journal]. Ledgers are stored in [/pulsar/data/bookkeeper/ledgers]. Indexes are stored in [/pulsar/data/bookkeeper/ledgers].
2026-06-01T19:52:13,170+0000 [main] ERROR org.apache.bookkeeper.server.Main - Failed to build bookie server
org.apache.commons.configuration2.ex.ConfigurationException: org.apache.commons.configuration2.ex.ConfigurationException: java.lang.ClassNotFoundException: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
	at org.apache.bookkeeper.common.util.ReflectionUtils.getClass(ReflectionUtils.java:123)
	at org.apache.bookkeeper.conf.ServerConfiguration.getStatsProviderClass(ServerConfiguration.java:3184)
	at org.apache.bookkeeper.server.service.StatsProviderService.<init>(StatsProviderService.java:41)
	at org.apache.bookkeeper.server.EmbeddedServer$Builder.build(EmbeddedServer.java:296)
	at org.apache.bookkeeper.server.Main.buildBookieServer(Main.java:277)
	at org.apache.bookkeeper.server.Main.doMain(Main.java:216)
	at org.apache.bookkeeper.server.Main.main(Main.java:199)
Caused by: org.apache.commons.configuration2.ex.ConfigurationException: java.lang.ClassNotFoundException: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
	at org.apache.bookkeeper.common.util.ReflectionUtils.getClass(ReflectionUtils.java:84)
	at org.apache.bookkeeper.common.util.ReflectionUtils.getClass(ReflectionUtils.java:114)
	... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Unknown Source)
	at java.base/java.lang.Class.forName(Unknown Source)
	at org.apache.bookkeeper.common.util.ReflectionUtils.getClass(ReflectionUtils.java:82)
	... 7 more
Looking at the code in question, I don't see an obvious 4.1 to 4.2 change in PrometheusMetricsProvider, so I'm guessing my local build is incorrectly configured?
@Lari Hotari Is this a common issue? Any idea where I can look
I had to hack the steps a tad to get it to work for me:
Copy code
command mvn install -pl docker/pulsar \
    -DskipTests \
    -Pmain,docker \
    -Ddocker.platforms=linux/amd64,linux/arm64 \
    -Ddocker.noCache=true \
    -Ddocker.skip.tag=false
I ran into errors with pulsar-all, I wasn't sure if there is some plugin or something that my image is missing
I don't have the original build logs but I think https://gist.github.com/chamons/b8000e582c563a155dcd1caefde3325c are close
There is no export
PULSAR_IMAGE=
in the instructions
l
this is related to Jetty 12 upgrade. The release notes in Pulsar 4.0.10 contain a better explanation that Pulsar 4.2.0 release notes. It also contains details for fixing the issue: https://pulsar.apache.org/release-notes/versioned/pulsar-4.0.10/#upgrade-notice See "Prometheus metrics provider class relocation"
c
Adding:
Copy code
statsProviderClass: "org.apache.pulsar.metrics.prometheus.bookkeeper.PrometheusMetricsProvider"
Seems to have worked, thanks!
๐Ÿ‘ 1
I only checked the 4.1 and 4.2 release notes and missed it