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

TEST: Static method in PanacheEntity with parameters type 'array of primitive' generate error during deployment phase #24228

Closed
luca-bassoricci opened this issue Mar 10, 2022 · 5 comments · Fixed by #24274
Labels
area/panache env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@luca-bassoricci
Copy link
Contributor

Describe the bug

Error in deployment phase when launching test caused by method enhancement of Panache's static methods which signature contains array of primitive parameter(s).
Error is present only during test s because the problem shows up only adding io.quarkus:quarkus-panache-mock dependency

Expected behavior

No errors

Actual behavior

Caused by: java.lang.IllegalArgumentException: Not a valid array name
	at org.jboss.jandex.Type.create(Type.java:144)
	at io.quarkus.deployment.util.AsmUtil.getParameterTypes(AsmUtil.java:707)
	at io.quarkus.panache.common.deployment.visitors.PanacheEntityClassOperationGenerationVisitor.visitMethod(PanacheEntityClassOperationGenerationVisitor.java:94)
	at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1353)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:744)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:424)
	at io.quarkus.deployment.steps.ClassTransformingBuildStep.transformClass(ClassTransformingBuildStep.java:321)
	at io.quarkus.deployment.steps.ClassTransformingBuildStep$2.call(ClassTransformingBuildStep.java:205)
	at io.quarkus.deployment.steps.ClassTransformingBuildStep$2.call(ClassTransformingBuildStep.java:192)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

How to Reproduce?

Link to reproducer
Run test

Output of uname -a or ver

Microsoft Windows [Versione 10.0.19042.1469]

Output of java -version

openjdk version "11.0.6" 2020-01-14 LTS

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.7.3.Final

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

Apache Maven 3.6.3

Additional information

Version 2.7.4.Final doesn't solve the problem

@luca-bassoricci luca-bassoricci added the kind/bug Something isn't working label Mar 10, 2022
@quarkus-bot quarkus-bot bot added area/panache env/windows Impacts Windows machines labels Mar 10, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 10, 2022

/cc @FroMage, @loicmathieu

@luca-bassoricci
Copy link
Contributor Author

I fixed the problem, but I have some trouble during building.
If no rush I'll try to solve my problems and then send my PR

@loicmathieu
Copy link
Contributor

Hi @luca-bassoricci thanks for trying to fix it !
Don't hesitate to open a draft PR (to avoid consuming CI with non-fonctionning PR) to gather feedback.
You can also ask for help on the Zulip #dev channel: https://quarkusio.zulipchat.com/#narrow/stream/187038-dev

There is no rush if you can wait for yourself ;)

@luca-bassoricci
Copy link
Contributor Author

My problems are related to vertx-http module: tests fail with this stacktrace:
quarkus-vertx-http-deployment --- TESTS

Caused by: java.lang.RuntimeException: Unable to start HTTP server
        at io.quarkus.vertx.http.runtime.VertxHttpRecorder.doServerStart(VertxHttpRecorder.java:625)
        at io.quarkus.vertx.http.runtime.VertxHttpRecorder.startServer(VertxHttpRecorder.java:282)
        at io.quarkus.deployment.steps.VertxHttpProcessor$openSocket1866188241.deploy_0(Unknown Source)
        at io.quarkus.deployment.steps.VertxHttpProcessor$openSocket1866188241.deploy(Unknown Source)
        ... 50 more
Caused by: java.util.concurrent.ExecutionException: io.quarkus.runtime.QuarkusBindException
        at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
        at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
        at io.quarkus.vertx.http.runtime.VertxHttpRecorder.doServerStart(VertxHttpRecorder.java:591)
        ... 53 more
Caused by: io.quarkus.runtime.QuarkusBindException

and I'm pretty sure no other services are running on port 8080 :/
any advice?

@loicmathieu
Copy link
Contributor

Tests runs on port 8081 normally.
Better open a draft PR or share a branch on your fork so we can have a look at the code.

gastaldi added a commit that referenced this issue Mar 16, 2022
Fix Jandex Type parsing for array of primitive
@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/panache env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants