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

Helidon 2.6.6集成OpenAPI UI遭遇NoClassDefFoundError问题求助

Helidon 2.6.6 OpenAPI UI 依赖冲突解决

你遇到的java.lang.NoClassDefFoundError: io/smallrye/openapi/ui/Option错误,根源是手动指定的smallrye-open-api-ui:2.0.0版本和Helidon 2.6.6内置的SmallRye OpenAPI版本不兼容,且helidon-integrations-openapi-ui已经集成了所需的UI组件,无需额外引入SmallRye的UI依赖。

修正后的pom.xml依赖配置

移除冲突的smallrye-open-api-ui依赖,保留以下两个即可:

<dependency>
    <groupId>io.helidon.microprofile.openapi</groupId>
    <artifactId>helidon-microprofile-openapi</artifactId>
    <scope>runtime</scope>
</dependency>
<dependency>
    <groupId>io.helidon.integrations.openapi-ui</groupId>
    <artifactId>helidon-integrations-openapi-ui</artifactId>
    <scope>runtime</scope>
</dependency>

补充说明

  • Helidon的BOM会自动管理所有依赖的兼容版本,无需手动指定第三方组件版本,从根源避免版本冲突问题。
  • 项目启动后,可通过/openapi路径访问OpenAPI文档,通过/openapi/ui路径访问Swagger UI界面。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.14 13:43:17