Repository: quarkusio/quarkus
Issue: Hibernate validation fails on a constructor parameter validation

### Describe the bug

I am getting a Hibernate exception like the one below when trying to add validation to the bean constructor method like this:

```
@ApplicationScoped
public class GrpcMetadataResolver {

  @Inject
  public GrpcMetadataResolver(GrpcMetadataConfig config, @SourceApi @Pattern(regexp = "rest|graphql") String sourceApi) {
    ...
  }
}
```

Removing the `@Pattern(regexp = "rest|graphql") ` makes the injection to work fine.

The stack trace from the cause:

```
	Caused by: java.lang.IllegalArgumentException: HV000181: Wrong number of parameters. Method or constructor class io.stargate.sgv2.api.common.grpc.GrpcMetadataResolver#GrpcMetadataResolver(GrpcMetadataConfig, String) expects 2 parameters, but got 0.
		at org.hibernate.validator.internal.engine.ValidatorImpl.validateParametersInContext(ValidatorImpl.java:842)
		at org.hibernate.validator.internal.engine.ValidatorImpl.validateParameters(ValidatorImpl.java:283)
		at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstructorParameters(ValidatorImpl.java:243)
		at io.quarkus.hibernate.validator.runtime.interceptor.AbstractMethodValidationInterceptor.validateConstructorInvocation(AbstractMethodValidationInterceptor.java:97)
		at io.quarkus.hibernate.validator.runtime.interceptor.MethodValidationInterceptor.validateConstructorInvocation(MethodValidationInterceptor.java:23)
		at io.quarkus.hibernate.validator.runtime.interceptor.MethodValidationInterceptor_Bean.intercept(Unknown Source)
		at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)
		at io.quarkus.arc.impl.LifecycleCallbackInvocationContext.invokeNext(LifecycleCallbackInvocationContext.java:53)
		at io.quarkus.arc.impl.LifecycleCallbackInvocationContext.proceed(LifecycleCallbackInvocationContext.java:28)
		... 202 more
```

Not sure if there are some config props to handle this behavior? I am sure why would the hibernate go for the no-args constructor here?

### Expected behavior

Injection and validation works.

### 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

2.13.2.Final

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

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537) Maven home: /home/ise/.m2/wrapper/dists/apache-maven-3.8.4-bin/52ccbt68d252mdldqsfsn03jlf/apache-maven-3.8.4 Java version: 17.0.4, vendor: Private Build, runtime: /usr/lib/jvm/java-17-openjdk-amd64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "5.15.0-52-generic", arch: "amd64", family: "unix"

### Additional information

_No response_

Changed files:
independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/MethodDescriptors.java
independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/LifecycleCallbackInvocationContext.java
independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/interceptors/aroundconstruct/AroundConstructTest.java
independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanGenerator.java
independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/AroundConstructInvocationContext.java
independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InvocationContexts.java

diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanGenerator.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanGenerator.java
index 002135d2146..698525b7650 100644
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanGenerator.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanGenerator.java
@@ -1428,8 +1428,14 @@ void implementCreateForClassBean(ClassOutput classOutput, ClassCreator beanCreat
                         annotationLiterals.create(create, bindingClass, binding));
             }
 
+            // ResultHandle of Object[] holding all constructor args
+            ResultHandle ctorArgsArray = create.newArray(Object.class, create.load(providerHandles.size()));
+            for (int i = 0; i < providerHandles.size(); i++) {
+                create.writeArrayValue(ctorArgsArray, i, providerHandles.get(i));
+            }
             ResultHandle invocationContextHandle = create.invokeStaticMethod(
                     MethodDescriptors.INVOCATION_CONTEXTS_AROUND_CONSTRUCT, constructorHandle,
+                    ctorArgsArray,
                     aroundConstructsHandle, func.getInstance(),
                     create.invokeStaticMethod(MethodDescriptors.SETS_OF, bindingsArray));
             TryBlock tryCatch = create.tryBlock();
diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/MethodDescriptors.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/MethodDescriptors.java
index 5f58546124e..f1762c7db4a 100644
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/MethodDescriptors.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/MethodDescriptors.java
@@ -170,7 +170,7 @@ public final class MethodDescriptors {
     public static final MethodDescriptor INVOCATION_CONTEXTS_AROUND_CONSTRUCT = MethodDescriptor.ofMethod(
             InvocationContexts.class,
             "aroundConstruct",
-            InvocationContext.class, Constructor.class, List.class, Supplier.class, Set.class);
+            InvocationContext.class, Constructor.class, Object[].class, List.class, Supplier.class, Set.class);
 
     public static final MethodDescriptor INVOCATION_CONTEXTS_POST_CONSTRUCT = MethodDescriptor.ofMethod(
             InvocationContexts.class,
diff --git a/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/AroundConstructInvocationContext.java b/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/AroundConstructInvocationContext.java
index 14056e5afa7..24e4328e540 100644
--- a/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/AroundConstructInvocationContext.java
+++ b/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/AroundConstructInvocationContext.java
@@ -13,9 +13,9 @@ class AroundConstructInvocationContext extends LifecycleCallbackInvocationContex
 
     private final Supplier<Object> aroundConstructForward;
 
-    AroundConstructInvocationContext(Constructor<?> constructor, Set<Annotation> interceptorBindings,
+    AroundConstructInvocationContext(Constructor<?> constructor, Object[] parameters, Set<Annotation> interceptorBindings,
             List<InterceptorInvocation> chain, Supplier<Object> aroundConstructForward) {
-        super(null, constructor, interceptorBindings, chain);
+        super(null, constructor, parameters, interceptorBindings, chain);
         this.aroundConstructForward = aroundConstructForward;
     }
 
diff --git a/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InvocationContexts.java b/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InvocationContexts.java
index 39db0202169..ef3c6394314 100644
--- a/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InvocationContexts.java
+++ b/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InvocationContexts.java
@@ -42,7 +42,7 @@ public static Object performAroundInvoke(Object target, Method method,
      */
     public static InvocationContext postConstruct(Object target, List<InterceptorInvocation> chain,
             Set<Annotation> interceptorBindings) {
-        return new LifecycleCallbackInvocationContext(target, null, interceptorBindings, chain);
+        return new LifecycleCallbackInvocationContext(target, null, null, interceptorBindings, chain);
     }
 
     /**
@@ -54,7 +54,7 @@ public static InvocationContext postConstruct(Object target, List<InterceptorInv
      */
     public static InvocationContext preDestroy(Object target, List<InterceptorInvocation> chain,
             Set<Annotation> interceptorBindings) {
-        return new LifecycleCallbackInvocationContext(target, null, interceptorBindings, chain);
+        return new LifecycleCallbackInvocationContext(target, null, null, interceptorBindings, chain);
     }
 
     /**
@@ -65,10 +65,12 @@ public static InvocationContext preDestroy(Object target, List<InterceptorInvoca
      * @return a new {@link javax.interceptor.AroundConstruct} invocation context
      */
     public static InvocationContext aroundConstruct(Constructor<?> constructor,
+            Object[] parameters,
             List<InterceptorInvocation> chain,
             Supplier<Object> aroundConstructForward,
             Set<Annotation> interceptorBindings) {
-        return new AroundConstructInvocationContext(constructor, interceptorBindings, chain, aroundConstructForward);
+        return new AroundConstructInvocationContext(constructor, parameters, interceptorBindings, chain,
+                aroundConstructForward);
     }
 
 }
diff --git a/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/LifecycleCallbackInvocationContext.java b/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/LifecycleCallbackInvocationContext.java
index c4cc1bfaac3..6aa8ee4e6e4 100644
--- a/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/LifecycleCallbackInvocationContext.java
+++ b/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/LifecycleCallbackInvocationContext.java
@@ -15,9 +15,9 @@ class LifecycleCallbackInvocationContext extends AbstractInvocationContext {
 
     private int position = 0;
 
-    LifecycleCallbackInvocationContext(Object target, Constructor<?> constructor, Set<Annotation> interceptorBindings,
-            List<InterceptorInvocation> chain) {
-        super(target, null, constructor, null, null, interceptorBindings, chain);
+    LifecycleCallbackInvocationContext(Object target, Constructor<?> constructor, Object[] parameters,
+            Set<Annotation> interceptorBindings, List<InterceptorInvocation> chain) {
+        super(target, null, constructor, parameters, null, interceptorBindings, chain);
     }
 
     @Override
diff --git a/independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/interceptors/aroundconstruct/AroundConstructTest.java b/independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/interceptors/aroundconstruct/AroundConstructTest.java
index 37a083de51c..b6d8a3706d6 100644
--- a/independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/interceptors/aroundconstruct/AroundConstructTest.java
+++ b/independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/interceptors/aroundconstruct/AroundConstructTest.java
@@ -1,9 +1,12 @@
 package io.quarkus.arc.test.interceptors.aroundconstruct;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.concurrent.atomic.AtomicBoolean;
 
+import javax.inject.Inject;
 import javax.inject.Singleton;
 import javax.interceptor.AroundConstruct;
 import javax.interceptor.Interceptor;
@@ -20,7 +23,7 @@ public class AroundConstructTest {
 
     @RegisterExtension
     public ArcTestContainer container = new ArcTestContainer(MyTransactional.class, SimpleBean.class,
-            SimpleInterceptor.class);
+            SimpleInterceptor.class, MyDependency.class);
 
     public static AtomicBoolean INTERCEPTOR_CALLED = new AtomicBoolean(false);
 
@@ -35,6 +38,25 @@ public void testInterception() {
     @MyTransactional
     static class SimpleBean {
 
+        @Inject
+        SimpleBean(MyDependency foo) {
+
+        }
+
+    }
+
+    @Singleton
+    static class MyDependency {
+
+        long created;
+
+        MyDependency() {
+            created = System.currentTimeMillis();
+        }
+
+        public long getCreated() {
+            return created;
+        }
     }
 
     @MyTransactional
@@ -44,6 +66,10 @@ public static class SimpleInterceptor {
         @AroundConstruct
         void mySuperCoolAroundConstruct(InvocationContext ctx) throws Exception {
             INTERCEPTOR_CALLED.set(true);
+            assertTrue(ctx.getParameters().length == 1);
+            Object param = ctx.getParameters()[0];
+            assertTrue(param instanceof MyDependency);
+            assertEquals(Arc.container().instance(MyDependency.class).get().getCreated(), ((MyDependency) param).getCreated());
             ctx.proceed();
         }