quarkus: RESTEasy Reactive: server exception mapper in endpoint makes CDI scopes clash

Describe the bug

I tried to add a @ServerExceptionMapper method in an endpoint, and was rewarded with this exception:

javax.enterprise.inject.spi.DefinitionException: Bean class rest.Login declares multiple scope type annotations: javax.inject.Singleton, javax.enterprise.context.RequestScoped

I’m guessing that RR adds those two scopes in different places, and they clash.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

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

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (20 by maintainers)

Most upvoted comments

Matej is right that the default scope should be just ignored if you produce an AutoAddScopeBuildItem, it’s because it is added by an annotation transformer with default priority and AutoAddScopeBuildItems are implemented by an annotation transformer with priority DEFAULT_PRIORITY + 1000. Both transformers skip classes annotated with a scope.

@FroMage do you have a branch I could try?