Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Picocli build breaks SSE client #36402

Closed
sdaschner opened this issue Oct 11, 2023 · 4 comments · Fixed by #36408
Closed

Native Picocli build breaks SSE client #36402

sdaschner opened this issue Oct 11, 2023 · 4 comments · Fixed by #36408
Assignees
Milestone

Comments

@sdaschner
Copy link
Contributor

sdaschner commented Oct 11, 2023

Describe the bug

When using Picocli and JAX-RS to consume SSEs, everything works well, until the app is built into a native executable.

The following exception is thrown, indicating that JAX-RS classes can't be found:

__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2023-10-11 10:25:39,671 INFO  [io.quarkus] (main) quarkus-playground-client 1.0 native (powered by Quarkus 3.2.0.Final) started in 0.009s. Listening on:
2023-10-11 10:25:39,672 INFO  [io.quarkus] (main) Profile prod activated.
2023-10-11 10:25:39,672 INFO  [io.quarkus] (main) Installed features: [cdi, picocli, rest-client, rest-client-jsonb, resteasy, resteasy-jsonb, smallrye-context-propagation, vertx]
running test run()
java.lang.RuntimeException: java.lang.ClassNotFoundException: Provider for jakarta.ws.rs.sse.SseEventSource.Builder cannot be found
	at jakarta.ws.rs.sse.SseEventSource$Builder.newBuilder(SseEventSource.java:140)
	at jakarta.ws.rs.sse.SseEventSource.target(SseEventSource.java:232)
	at com.sebastian_daschner.client.SseClient.someMethod(SseClient.java:35)
	at com.sebastian_daschner.client.SseClient_ClientProxy.someMethod(Unknown Source)
	at com.sebastian_daschner.client.TestCommand.run(TestCommand.java:26)
	at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
	at picocli.CommandLine.access$1500(CommandLine.java:148)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
	at io.quarkus.picocli.runtime.PicocliRunner$EventExecutionStrategy.execute(PicocliRunner.java:26)
	at picocli.CommandLine.execute(CommandLine.java:2170)
	at io.quarkus.picocli.runtime.PicocliRunner.run(PicocliRunner.java:40)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:132)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Provider for jakarta.ws.rs.sse.SseEventSource.Builder cannot be found
	at jakarta.ws.rs.sse.FactoryFinder.find(FactoryFinder.java:163)
	at jakarta.ws.rs.sse.SseEventSource$Builder.newBuilder(SseEventSource.java:125)
	... 18 more
2023-10-11 10:25:39,678 INFO  [io.quarkus] (main) quarkus-playground-client stopped in 0.002s

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

Reproducer here: https://github.com/sdaschner/quarkus-playground/tree/36402-sse-native-cli

cd server/
mvn package
java -jar target/quarkus-app/quarkus-run.jar

# different shell
cd client/
mvn package
java -jar target/quarkus-app/quarkus-run.jar --client
# works

mvn package -Dquarkus.package.type=native
target/client-runner --client
# fails with exception

Output of uname -a or ver

No response

Output of java -version

OpenJDK Runtime Environment Temurin-18.0.1+10 (build 18.0.1+10)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.4.2

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@sdaschner sdaschner added the kind/bug Something isn't working label Oct 11, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 11, 2023

/cc @ebullient (picocli)

sdaschner added a commit to sdaschner/quarkus-playground that referenced this issue Oct 11, 2023
geoand added a commit to geoand/quarkus that referenced this issue Oct 11, 2023
geoand added a commit to geoand/quarkus that referenced this issue Oct 11, 2023
@geoand
Copy link
Contributor

geoand commented Oct 11, 2023

Thanks for reporting.

#36408 fixes the issue

@geoand geoand self-assigned this Oct 11, 2023
geoand added a commit that referenced this issue Oct 11, 2023
Ensure that SSE builder works in native
@quarkus-bot quarkus-bot bot added this to the 3.6 - main milestone Oct 11, 2023
@gsmet gsmet modified the milestones: 3.6 - main, 3.4.3 Oct 11, 2023
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 11, 2023
@sdaschner
Copy link
Contributor Author

It works, thanks a lot!

@geoand
Copy link
Contributor

geoand commented Oct 13, 2023

🎉

gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 17, 2023
@aloubyansky aloubyansky modified the milestones: 3.4.3, 3.2.8.Final Nov 2, 2023
aloubyansky pushed a commit to aloubyansky/quarkus that referenced this issue Nov 2, 2023
mocenas added a commit to mocenas/quarkus-test-suite that referenced this issue Nov 7, 2023
benkard pushed a commit to benkard/mulkcms2 that referenced this issue Nov 12, 2023
This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [flow-bin](https://github.com/flowtype/flow-bin) ([changelog](https://github.com/facebook/flow/blob/master/Changelog.md)) | devDependencies | minor | [`^0.217.0` -> `^0.219.0`](https://renovatebot.com/diffs/npm/flow-bin/0.217.2/0.219.0) |
| [io.hypersistence:hypersistence-utils-hibernate-62](https://github.com/vladmihalcea/hypersistence-utils) | compile | minor | `3.5.3` -> `3.6.0` |
| [io.quarkus:quarkus-maven-plugin](https://github.com/quarkusio/quarkus) | build | patch | `3.4.2` -> `3.4.3` |
| [io.quarkus:quarkus-universe-bom](https://github.com/quarkusio/quarkus-platform) | import | patch | `3.4.2` -> `3.4.3` |

---

### Release Notes

<details>
<summary>flowtype/flow-bin</summary>

### [`v0.219.0`](flow/flow-bin@1268ec5...c184c5d)

[Compare Source](flow/flow-bin@1268ec5...c184c5d)

### [`v0.218.1`](flow/flow-bin@12afce4...1268ec5)

[Compare Source](flow/flow-bin@12afce4...1268ec5)

### [`v0.218.0`](flow/flow-bin@dc93913...12afce4)

[Compare Source](flow/flow-bin@dc93913...12afce4)

</details>

<details>
<summary>vladmihalcea/hypersistence-utils</summary>

### [`v3.6.0`](https://github.com/vladmihalcea/hypersistence-utils/blob/HEAD/changelog.txt#Version-360---October-12-2023)

\================================================================================

Implement QueryStackTraceLogger using StackWalker [#&#8203;659](vladmihalcea/hypersistence-utils#659)

Add JFR based query logger [#&#8203;658](vladmihalcea/hypersistence-utils#658)

Adds support for using MonetaryAmount in [@&#8203;ElementCollection](https://github.com/ElementCollection) [#&#8203;652](vladmihalcea/hypersistence-utils#652)

</details>

<details>
<summary>quarkusio/quarkus</summary>

### [`v3.4.3`](https://github.com/quarkusio/quarkus/releases/tag/3.4.3)

[Compare Source](quarkusio/quarkus@3.4.2...3.4.3)

##### Complete changelog

-   [#&#8203;36408](quarkusio/quarkus#36408) - Ensure that SSE builder works in native
-   [#&#8203;36404](quarkusio/quarkus#36404) - Do not exclude properties from recording that are available in sources that should always be included
-   [#&#8203;36403](quarkusio/quarkus#36403) - IBM Db2 - Register resource bundle classes for reflection
-   [#&#8203;36402](quarkusio/quarkus#36402) - Native Picocli build breaks SSE client
-   [#&#8203;36399](quarkusio/quarkus#36399) - quarkus-jdbc-db2: resource bundle missing
-   [#&#8203;36377](quarkusio/quarkus#36377) - Allow `@ClientHeaderParam` to override User-Agent
-   [#&#8203;36371](quarkusio/quarkus#36371) - Fix issue in Java migration in dev-mode
-   [#&#8203;36351](quarkusio/quarkus#36351) - Properly handle invalid response body errors in Reactive REST Client
-   [#&#8203;36329](quarkusio/quarkus#36329) - Custom User-Agent header ignored
-   [#&#8203;36326](quarkusio/quarkus#36326) - Cannot load fixed or default YAML configuration when running native build
-   [#&#8203;36302](quarkusio/quarkus#36302) - Fix headers and preambles in all guides and reintroduce some keywords
-   [#&#8203;36299](quarkusio/quarkus#36299) - quarkus-flyway: Java-Migration does not get picked up on live reload
-   [#&#8203;36290](quarkusio/quarkus#36290) - Fixed URL for configuring JSON support
-   [#&#8203;36257](quarkusio/quarkus#36257) - Rest client call hangs when receiving an invalid chunked response and does not release resources (e.g. Bulkhead semaphore)
-   [#&#8203;36147](quarkusio/quarkus#36147) - Bump org.eclipse.parsson:parsson from 1.1.2 to 1.1.4
-   [#&#8203;36096](quarkusio/quarkus#36096) - Build cache - Use notCacheableBecause instead of storeEnabled
-   [#&#8203;35929](quarkusio/quarkus#35929) - Do not store build cache for core extensions having config
-   [#&#8203;35927](quarkusio/quarkus#35927) - Build cache - Core extensions containing config shouldn't be cached
-   [#&#8203;35769](quarkusio/quarkus#35769) - Default response content type using GraphQL spec

</details>

<details>
<summary>quarkusio/quarkus-platform</summary>

### [`v3.4.3`](quarkusio/quarkus-platform@3.4.2...3.4.3)

[Compare Source](quarkusio/quarkus-platform@3.4.2...3.4.3)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

👻 **Immortal**: This MR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants