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

Combination of quarkus-resteasy,quarkus-spring-data-rest ends with "Cannot generate HAL endpoints" #26318

Closed
rsvoboda opened this issue Jun 23, 2022 · 3 comments · Fixed by #26373
Labels
area/spring Issues relating to the Spring integration kind/bug Something isn't working
Milestone

Comments

@rsvoboda
Copy link
Member

rsvoboda commented Jun 23, 2022

Describe the bug

Combination of quarkus-resteasy,quarkus-spring-data-rest ends with "Cannot generate HAL endpoints"

HAL was introduced in https://github.com/quarkusio/quarkus/pull/25396/files by @Sgitario

2022-06-23 15:16:56,114 INFO  [org.jbo.threads] (main) JBoss Threads version 3.4.2.Final
2022-06-23 15:16:56,160 WARN  [io.qua.agr.dep.AgroalProcessor] (build-32) The Agroal dependency is present but no JDBC datasources have been defined.
2022-06-23 15:16:56,320 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start live reload endpoint to recover from previous Quarkus startup failure
2022-06-23 15:16:56,487 INFO  [org.jbo.threads] (main) JBoss Threads version 3.4.2.Final
2022-06-23 15:16:56,678 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.resteasy.links.deployment.LinksProcessor#addHalSupport threw an exception: java.lang.IllegalStateException: Cannot generate HAL endpoints without either 'quarkus-resteasy-jsonb' or 'quarkus-resteasy-jackson'
	at io.quarkus.resteasy.links.deployment.LinksProcessor.addHalSupport(LinksProcessor.java:20)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:944)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:330)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:252)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:60)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:95)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:485)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:68)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:147)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:102)
	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:131)
	at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62)
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.resteasy.links.deployment.LinksProcessor#addHalSupport threw an exception: java.lang.IllegalStateException: Cannot generate HAL endpoints without either 'quarkus-resteasy-jsonb' or 'quarkus-resteasy-jackson'
	at io.quarkus.resteasy.links.deployment.LinksProcessor.addHalSupport(LinksProcessor.java:20)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:944)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

	at io.quarkus.builder.Execution.run(Execution.java:116)
	at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
	at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:157)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:328)
	... 9 more
Caused by: java.lang.IllegalStateException: Cannot generate HAL endpoints without either 'quarkus-resteasy-jsonb' or 'quarkus-resteasy-jackson'
	at io.quarkus.resteasy.links.deployment.LinksProcessor.addHalSupport(LinksProcessor.java:20)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:944)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

Expected behavior

No error is thrown, I'm not using HAL at all.

Actual behavior

Error when building the app

How to Reproduce?

quarkus create app app -x quarkus-resteasy,quarkus-spring-data-rest
cd app
quarkus dev

Output of uname -a or ver

macOS Monterey

Output of java -version

Java 17

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.10.0.Final

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

No response

Additional information

No response

@rsvoboda rsvoboda added the kind/bug Something isn't working label Jun 23, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 23, 2022

/cc @geoand

@quarkus-bot quarkus-bot bot added the area/spring Issues relating to the Spring integration label Jun 23, 2022
@rsvoboda
Copy link
Member Author

rsvoboda commented Jun 23, 2022

The same error happens with another combinations too.

quarkus-resteasy-qute + quarkus-hibernate-orm-rest-data-panache

quarkus-resteasy-qute + quarkus-mongodb-rest-data-panache

@Sgitario
Copy link
Contributor

I will fix this issue by reporting this error only if there are resources in the application and HAL is enabled.
Note that for the extension quarkus-spring-data-rest HAL is enabled by default (it mimics what Spring Boot does), so the combination quarkus-resteasy,quarkus-spring-data-rest will fail if you add a resource (tho it will work for your combinations test suite as no resources are added).

Sgitario added a commit to Sgitario/quarkus that referenced this issue Jun 27, 2022
Fix quarkusio#26318

Note that I haven't added any tests as there are already existing coverage that verifies this continue working fine.
@quarkus-bot quarkus-bot bot added this to the 2.11 - main milestone Jun 27, 2022
@gsmet gsmet modified the milestones: 2.11 - main, 2.10.1.Final Jun 28, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jun 28, 2022
Fix quarkusio#26318

Note that I haven't added any tests as there are already existing coverage that verifies this continue working fine.

(cherry picked from commit 3079078)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/spring Issues relating to the Spring integration kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants