Repository: quarkusio/quarkus
Issue: Injection error in start with 1.7.CR1

check out https://github.com/RedHatInsights/policies-ui-backend , do mvn clean test -> all good with 1.6.0 (and all versions before)

Now replace in pom. xml the 1.6.Final with 1.7.CR1 -> the above fails. Run with mvn quarkus:dev, the following is printed at startup:

```
2020-07-31 22:00:38,141 ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread) Error running Quarkus: java.lang.reflect.InvocationTargetException
        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.runner.bootstrap.StartupActionImpl$3.run(StartupActionImpl.java:145)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ExceptionInInitializerError
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at java.base/java.lang.Class.newInstance(Class.java:584)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:60)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:106)
        at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
        ... 6 more
Caused by: java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl.<clinit>(ApplicationImpl.zig:436)
        ... 15 more
Caused by: java.lang.RuntimeException: Error injecting com.redhat.cloud.policies.app.RbacServer com.redhat.cloud.policies.app.auth.RbacFilter.rbac
        at com.redhat.cloud.policies.app.auth.RbacFilter_Bean.create(RbacFilter_Bean.zig:376)
        at com.redhat.cloud.policies.app.auth.RbacFilter_Bean.create(RbacFilter_Bean.zig:528)
        at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:88)
        at io.quarkus.arc.impl.ComputingCache$CacheFunction.lambda$apply$0(ComputingCache.java:99)
        at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
        at io.quarkus.arc.impl.ComputingCache.getValue(ComputingCache.java:41)
        at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:25)
        at com.redhat.cloud.policies.app.auth.RbacFilter_Bean.get(RbacFilter_Bean.zig:560)
        at com.redhat.cloud.policies.app.auth.RbacFilter_Bean.get(RbacFilter_Bean.zig:576)
        at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:408)
        at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:421)
        at io.quarkus.arc.impl.ArcContainerImpl$1.get(ArcContainerImpl.java:249)
        at io.quarkus.arc.impl.ArcContainerImpl$1.get(ArcContainerImpl.java:246)
        at io.quarkus.arc.runtime.ArcRecorder$2$1.create(ArcRecorder.java:84)
        at io.quarkus.resteasy.common.runtime.QuarkusConstructorInjector.construct(QuarkusConstructorInjector.java:39)
        at org.jboss.resteasy.core.providerfactory.ResteasyProviderFactoryImpl.injectedInstance(ResteasyProviderFactoryImpl.java:1398)
        at org.jboss.resteasy.core.interception.jaxrs.JaxrsInterceptorRegistryImpl$AbstractInterceptorFactory.createInterceptor(JaxrsInterceptorRegistryImpl.java:150)
        at org.jboss.resteasy.core.interception.jaxrs.JaxrsInterceptorRegistryImpl$OnDemandInterceptorFactory.initialize(JaxrsInterceptorRegistryImpl.java:168)
        at org.jboss.resteasy.core.interception.jaxrs.JaxrsInterceptorRegistryImpl$OnDemandInterceptorFactory.checkInitialize(JaxrsInterceptorRegistryImpl.java:183)
        at org.jboss.resteasy.core.interception.jaxrs.JaxrsInterceptorRegistryImpl$OnDemandInterceptorFactory.getInterceptor(JaxrsInterceptorRegistryImpl.java:194)
        at org.jboss.resteasy.core.interception.jaxrs.JaxrsInterceptorRegistryImpl$AbstractInterceptorFactory.postMatch(JaxrsInterceptorRegistryImpl.java:131)
        at org.jboss.resteasy.core.interception.jaxrs.JaxrsInterceptorRegistryImpl.postMatch(JaxrsInterceptorRegistryImpl.java:283)
        at org.jboss.resteasy.core.interception.jaxrs.ContainerRequestFilterRegistryImpl.postMatch(ContainerRequestFilterRegistryImpl.java:30)
        at org.jboss.resteasy.core.interception.jaxrs.ContainerRequestFilterRegistryImpl.postMatch(ContainerRequestFilterRegistryImpl.java:12)
        at org.jboss.resteasy.core.ResourceMethodInvoker.<init>(ResourceMethodInvoker.java:140)
        at org.jboss.resteasy.core.ResourceMethodRegistry.processMethod(ResourceMethodRegistry.java:382)
        at org.jboss.resteasy.core.ResourceMethodRegistry.register(ResourceMethodRegistry.java:309)
        at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:260)
        at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:227)
        at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:208)
        at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:192)
        at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:175)
        at org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:87)
        at org.jboss.resteasy.core.ResteasyDeploymentImpl.registerResources(ResteasyDeploymentImpl.java:515)
        at org.jboss.resteasy.core.ResteasyDeploymentImpl.registration(ResteasyDeploymentImpl.java:472)
        at org.jboss.resteasy.core.ResteasyDeploymentImpl.startInternal(ResteasyDeploymentImpl.java:162)
        at org.jboss.resteasy.core.ResteasyDeploymentImpl.start(ResteasyDeploymentImpl.java:118)
        at io.quarkus.resteasy.runtime.standalone.ResteasyStandaloneRecorder.staticInit(ResteasyStandaloneRecorder.java:71)
        at io.quarkus.deployment.steps.ResteasyStandaloneBuildStep$staticInit-210558872.deploy_0(ResteasyStandaloneBuildStep$staticInit-210558872.zig:810)
        at io.quarkus.deployment.steps.ResteasyStandaloneBuildStep$staticInit-210558872.deploy(ResteasyStandaloneBuildStep$staticInit-210558872.zig:40)
        at io.quarkus.runner.ApplicationImpl.<clinit>(ApplicationImpl.zig:394)
        ... 15 more
Caused by: javax.enterprise.inject.CreationException: Synthetic bean instance not initialized yet: org_eclipse_microprofile_context_ManagedExecutor_97d170e1550eee4afc0af065b78cda302a97674c
        at org.eclipse.microprofile.context.ManagedExecutor_29efa7b6c09f5f806580e59c31b0b9832488e1e4_Synthetic_Bean.create(ManagedExecutor_29efa7b6c09f5f806580e59c31b0b9832488e1e4_Synthetic_Bean.zig:115)
        at org.eclipse.microprofile.context.ManagedExecutor_29efa7b6c09f5f806580e59c31b0b9832488e1e4_Synthetic_Bean.create(ManagedExecutor_29efa7b6c09f5f806580e59c31b0b9832488e1e4_Synthetic_Bean.zig:138)
        at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:88)
        at io.quarkus.arc.impl.ComputingCache$CacheFunction.lambda$apply$0(ComputingCache.java:99)
        at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
        at io.quarkus.arc.impl.ComputingCache.getValue(ComputingCache.java:41)
        at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:25)
        at org.eclipse.microprofile.context.ManagedExecutor_29efa7b6c09f5f806580e59c31b0b9832488e1e4_Synthetic_Bean.get(ManagedExecutor_29efa7b6c09f5f806580e59c31b0b9832488e1e4_Synthetic_Bean.zig:170)
        at org.eclipse.microprofile.context.ManagedExecutor_29efa7b6c09f5f806580e59c31b0b9832488e1e4_Synthetic_Bean.get(ManagedExecutor_29efa7b6c09f5f806580e59c31b0b9832488e1e4_Synthetic_Bean.zig:186)
        at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:408)
        at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:421)
        at io.quarkus.arc.impl.ArcContainerImpl.instanceHandle(ArcContainerImpl.java:391)
        at io.quarkus.arc.impl.ArcContainerImpl.instance(ArcContainerImpl.java:205)
        at io.quarkus.restclient.runtime.RestClientBase.create(RestClientBase.java:60)
        at com.redhat.cloud.policies.app.RbacServer_175c6127e4261f4f0b6cddf18a2ed3ab43163b13_Synthetic_Bean.create(RbacServer_175c6127e4261f4f0b6cddf18a2ed3ab43163b13_Synthetic_Bean.zig:188)
        at com.redhat.cloud.policies.app.RbacServer_175c6127e4261f4f0b6cddf18a2ed3ab43163b13_Synthetic_Bean.get(RbacServer_175c6127e4261f4f0b6cddf18a2ed3ab43163b13_Synthetic_Bean.zig:219)
        at com.redhat.cloud.policies.app.RbacServer_175c6127e4261f4f0b6cddf18a2ed3ab43163b13_Synthetic_Bean.get(RbacServer_175c6127e4261f4f0b6cddf18a2ed3ab43163b13_Synthetic_Bean.zig:242)
        at io.quarkus.arc.impl.CurrentInjectionPointProvider.get(CurrentInjectionPointProvider.java:52)
        at com.redhat.cloud.policies.app.auth.RbacFilter_Bean.create(RbacFilter_Bean.zig:359)
        ... 55 more


```





Changed files:
extensions/smallrye-context-propagation/deployment/src/main/java/io/quarkus/smallrye/context/deployment/SmallRyeContextPropagationProcessor.java
independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanConfiguratorBase.java
independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BuiltinScope.java

diff --git a/extensions/smallrye-context-propagation/deployment/src/main/java/io/quarkus/smallrye/context/deployment/SmallRyeContextPropagationProcessor.java b/extensions/smallrye-context-propagation/deployment/src/main/java/io/quarkus/smallrye/context/deployment/SmallRyeContextPropagationProcessor.java
index 6d59bfbb87e..067b30ee81d 100644
--- a/extensions/smallrye-context-propagation/deployment/src/main/java/io/quarkus/smallrye/context/deployment/SmallRyeContextPropagationProcessor.java
+++ b/extensions/smallrye-context-propagation/deployment/src/main/java/io/quarkus/smallrye/context/deployment/SmallRyeContextPropagationProcessor.java
@@ -4,7 +4,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.inject.Singleton;
+import javax.enterprise.context.ApplicationScoped;
 
 import org.eclipse.microprofile.context.ManagedExecutor;
 import org.eclipse.microprofile.context.spi.ContextManagerExtension;
@@ -76,7 +76,10 @@ void build(SmallRyeContextPropagationRecorder recorder,
 
         // Synthetic bean for ManagedExecutor
         syntheticBeans.produce(
-                SyntheticBeanBuildItem.configure(ManagedExecutor.class).scope(Singleton.class).defaultBean().unremovable()
+                SyntheticBeanBuildItem.configure(ManagedExecutor.class)
+                        .scope(ApplicationScoped.class)
+                        .defaultBean()
+                        .unremovable()
                         .supplier(recorder.initializeManagedExecutor(executorBuildItem.getExecutorProxy()))
                         .setRuntimeInit().done());
 
diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanConfiguratorBase.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanConfiguratorBase.java
index ec88d6e85c3..19db35f09c5 100644
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanConfiguratorBase.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanConfiguratorBase.java
@@ -12,7 +12,6 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
-import java.util.Optional;
 import java.util.Set;
 import java.util.function.Consumer;
 import javax.enterprise.context.NormalScope;
@@ -135,8 +134,13 @@ public B scope(ScopeInfo scope) {
 
     public B scope(Class<? extends Annotation> scope) {
         DotName scopeName = DotName.createSimple(scope.getName());
-        this.scope = Optional.ofNullable(BuiltinScope.from(scopeName)).map(BuiltinScope::getInfo).orElse(new ScopeInfo(
-                scopeName, scope.isAnnotationPresent(NormalScope.class), scope.isAnnotationPresent(Inherited.class)));
+        BuiltinScope builtinScope = BuiltinScope.from(scopeName);
+        if (builtinScope != null) {
+            this.scope = builtinScope.getInfo();
+        } else {
+            this.scope = new ScopeInfo(scopeName, scope.isAnnotationPresent(NormalScope.class),
+                    scope.isAnnotationPresent(Inherited.class));
+        }
         return self();
     }
 
diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BuiltinScope.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BuiltinScope.java
index 97a7948ae32..55c342c873e 100644
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BuiltinScope.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BuiltinScope.java
@@ -30,9 +30,9 @@ public DotName getName() {
         return info.getDotName();
     }
 
-    public static BuiltinScope from(DotName name) {
+    public static BuiltinScope from(DotName scopeAnnotationName) {
         for (BuiltinScope scope : BuiltinScope.values()) {
-            if (scope.getInfo().getDotName().equals(name)) {
+            if (scope.getInfo().getDotName().equals(scopeAnnotationName)) {
                 return scope;
             }
         }