Skip to content

Native application execution failure with @Retry on the class and private methods #47509

@s4iko

Description

@s4iko

Describe the bug

Hi,

a native application fails to start with the following logs:

2025-04-23 17:43:09,812 ERROR [io.qua.run.Application] (main) Failed to start application: java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
        at io.quarkus.runtime.Application.start(Application.java:101)
        at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:119)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:80)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:51)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:144)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
Caused by: jakarta.enterprise.inject.spi.DeploymentException: java.lang.NoSuchMethodException: TestRestryService.myPrivateMethod()
        at io.quarkus.smallrye.faulttolerance.runtime.SmallRyeFaultToleranceRecorder.createFaultToleranceOperation(SmallRyeFaultToleranceRecorder.java:44)
        at io.quarkus.runner.recorded.SmallRyeFaultToleranceProcessor$processFaultToleranceAnnotations1222864980.deploy_0(Unknown Source)
        at io.quarkus.runner.recorded.SmallRyeFaultToleranceProcessor$processFaultToleranceAnnotations1222864980.deploy(Unknown Source)
        ... 7 more
Caused by: java.lang.NoSuchMethodException: TestRestryService.myPrivateMethod()
        at [email protected]/java.lang.Class.checkMethod(DynamicHub.java:1078)
        at [email protected]/java.lang.Class.getDeclaredMethod(DynamicHub.java:1168)
        at io.smallrye.faulttolerance.autoconfig.MethodDescriptor.reflect(MethodDescriptor.java:28)
        at io.quarkus.smallrye.faulttolerance.runtime.SmallRyeFaultToleranceRecorder.createFaultToleranceOperation(SmallRyeFaultToleranceRecorder.java:31)
        ... 9 more

This is caused by the use of @Retry at class level in a class with a private method.

Thanks for the help.

Expected behavior

The native application start properly.

Actual behavior

The native application fails.

How to Reproduce?

code-with-quarkus-native-retry.zip

  • build a native executable (with Docker mvn install -Dnative -DskipTests -Dquarkus.native.container-build=true)
  • run the native app: ./target/code-with-quarkus-1.0.0-SNAPSHOT-runner

Output of uname -a or ver

Ubuntu 24.04.2 LTS

Output of java -version

openjdk version "21.0.6" 2025-01-21

Mandrel or GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.21.3

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

Apache Maven 3.8.7

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions