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

如何解决Extent Reports引发的java.lang.NoClassDefFoundError异常?

问题原因

java.lang.NoClassDefFoundError: io/reactivex/rxjava3/subjects/PublishSubject这个异常的核心原因是项目缺失RxJava3依赖。新版Extent Reports内部依赖RxJava3实现响应式逻辑,运行时找不到该类就会触发这个错误。

修复方案

根据你的项目构建工具,添加对应的RxJava3依赖:

Maven

在pom.xml中插入依赖配置:

<dependency>
    <groupId>io.reactivex.rxjava3</groupId>
    <artifactId>rxjava</artifactId>
    <version>3.1.8</version> <!-- 可替换为最新稳定版 -->
    <scope>test</scope> <!-- 仅测试代码使用Extent Reports时添加此范围 -->
</dependency>

Gradle

在build.gradle中添加:

testImplementation 'io.reactivex.rxjava3:rxjava:3.1.8'

无构建工具场景

直接下载RxJava3的jar包,添加到项目的classpath路径下即可。

额外提示
  • 确保RxJava3版本与Extent Reports版本兼容,优先选择Extent Reports官方文档推荐的RxJava版本,或使用RxJava3的最新稳定版。
  • 若之前项目用的是RxJava2,需替换为RxJava3——新版Extent Reports不再兼容RxJava2。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.05 14:55:22