helidon-mp 4.0.0-M1 应用程序中没有可用端点

问题描述 投票:0回答:1

我正在尝试 4.0.0-M1 和 helidon-mp。我有一个简单的应用程序,带有数据库连接。但是我正在使用 CDI,并且想知道为什么没有暴露端点。我在 localhost:8080 上的所有端点都会产生 404 (例如 /health、/metrics、/rateMgmt/v1 - 我的端点)。我想知道是否有一种特殊的方法来列出所有可用的端点,或者 CDI 是否在 4.0.0-M1 中尚不可用。

这是我的启动日志:

2023-08-16 16:21:59 INFO  Version:150 - WELD-000900: 5.1.0 (Final)
2023-08-16 16:21:59 INFO  Bootstrap:67 - WELD-ENV-000020: Using jandex for bean discovery
2023-08-16 16:21:59 INFO  Bootstrap:228 - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
2023-08-16 16:22:00 WARN  ServerCdiExtension:449 - There are no JAX-RS applications or resources. Maybe you forgot META-INF/beans.xml file?
2023-08-16 16:22:00 INFO  ServerListener:281 - [0x25f15f50] http://0.0.0.0:8080 bound for socket '@default'
2023-08-16 16:22:00 INFO  LoomServer:298 - Started all channels in 5 milliseconds. 4189 milliseconds since JVM startup. Java 20.0.1+9-29
2023-08-16 16:22:00 INFO  ServerCdiExtension:410 - Server started on http://localhost:8080 (and all other host addresses) in 4211 milliseconds (since JVM startup).
2023-08-16 16:22:00 INFO  HelidonFeatures:192 - Helidon MP 4.0.0-M1 features: [Server]

我想知道 CDI 没有出现在列出的功能中。

....

我可以自己回答。我创建了一个 uber-jar,显然 CDI 检测不起作用。 使用 slim jar,我在启动时得到这些日志:

[javax.sql.main.connection.url] VALUE 'jdbc:oracle:thin:@localhost:1521/DEV_RAS_TST_S1_D1'
2023-08-16 18:56:27 INFO  VersionPrinter:42 - Flyway Community Edition 7.15.0 by Redgate
2023-08-16 18:56:27 INFO  BaseDatabaseType:42 - Database: jdbc:oracle:thin:@localhost:1521/DEV_RAS_TST_S1_D1 (Oracle 19.0)
2023-08-16 18:56:27 INFO  DbValidate:42 - Successfully validated 3 migrations (execution time 00:00.037s)
2023-08-16 18:56:27 INFO  DbMigrate:42 - Current version of schema "TST_S1_D1_OWNER": 3
2023-08-16 18:56:27 INFO  DbMigrate:42 - Schema "TST_S1_D1_OWNER" is up to date. No migration necessary.
Total Migrations : 0
2023-08-16 18:56:27 INFO  ServerCdiExtension:579 - Registering JAX-RS Application: HelidonMP
2023-08-16 18:56:28 INFO  ServerListener:281 - [0x315365ef] http://0.0.0.0:8080 bound for socket '@default'
2023-08-16 18:56:28 INFO  LoomServer:298 - Started all channels in 4 milliseconds. 10594 milliseconds since JVM startup. Java 20.0.1+9-29
2023-08-16 18:56:28 INFO  ServerCdiExtension:410 - Server started on http://localhost:8080 (and all other host addresses) in 10600 milliseconds (since JVM startup).
2023-08-16 18:56:28 WARN  scanner:208 - SROAP04005: Could not find schema class in index: io.helidon.examples.quickstart.mp.Models.RatePlanType
2023-08-16 18:56:28 WARN  scanner:208 - SROAP04005: Could not find schema class in index: io.helidon.examples.quickstart.mp.Models.RatePlanType
2023-08-16 18:56:28 INFO  HelidonFeatures:192 - Helidon MP 4.0.0-M1 features: [CDI, Config, Metrics, Open API, Server, WebServer]
cdi helidon
1个回答
0
投票

正如您自己发现的那样,Helidon 不支持 uber-jars。

© www.soinside.com 2019 - 2024. All rights reserved.