You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Apache Phoenix JDBC报错NoClassDefFoundError: org/cloudera/htrace/Sampler求助

Hey there! That NoClassDefFoundError is telling us exactly what's missing—your project doesn't have the Jar that contains the org.cloudera.htrace.Sampler class.

The Missing Jar

You need the htrace-core4 Jar package (or a version compatible with your Phoenix release). This class is part of the HTrace library, which Phoenix relies on for tracing-related functionality under the hood.

How to Fix It

If you're using Maven:

Add this dependency to your pom.xml (make sure the version matches your Phoenix version—for example, Phoenix 5.x typically pairs with htrace-core4 4.2.0-incubating):

<dependency>
    <groupId>org.apache.htrace</groupId>
    <artifactId>htrace-core4</artifactId>
    <version>4.2.0-incubating</version>
    <scope>runtime</scope>
</dependency>

If you're manually managing Jars:

Download the appropriate htrace-core4 Jar (matching your Phoenix version) and add it to your project's classpath. Double-check that you're using a version compatible with your Phoenix JDBC driver to avoid version conflicts that could cause other unexpected errors.

Quick Tip

Always keep all your Phoenix-related dependencies (JDBC driver, htrace, etc.) on the same version line—mixing mismatched versions is a common source of classpath issues like this one.

内容的提问来源于stack exchange,提问作者Ranit Dholey

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:54:56