You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use generics in synthetic bean creation.
I create a List<Class<?>> Using the following
syntheticBeanProducer.produce( SyntheticBeanBuildItem.configure(List.class) .scope(Singleton.class) .addType(com.crv.jms.Util.createType()) .unremovable() .addQualifier().annotation(Identifier.class).addValue("value", name).done() .createWith( recorder.createSupportedEventTypesList(supportedEventTypes)) .unremovable() .done());
And then specify its need in another syntheticBeanProducer
I would suspect that this would work. however it just gives the error.
[ERROR] HealthCheckTest.testHealth » Runtime java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: jakarta.enterprise.inject.spi.DeploymentException: jakarta.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type java.util.List<java.lang.Class<?>> and qualifiers [@io.smallrye.common.annotation.Identifier("test")]
- synthetic injection point
- declared on SYNTHETIC bean [types=[java.lang.Object, com.crv.jms.EventProducer], qualifiers=[@Any, @io.smallrye.common.annotation.Identifier("test")], target=n/a]
The following beans match by type, but none has matching qualifiers:
- PRODUCER METHOD bean [types=[java.util.List, java.lang.Object], qualifiers=[@Any, @ConfigProperty], target=java.util.List producesListConfigProperty(jakarta.enterprise.inject.spi.InjectionPoint ip), declaringBean=io.smallrye.config.inject.ConfigProducer]
I am suspecting that something is wrong during the generation of the List<Class<?>>. Does anyone have any insights?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all,
I'm trying to use generics in synthetic bean creation.
I create a List<Class<?>> Using the following
syntheticBeanProducer.produce( SyntheticBeanBuildItem.configure(List.class) .scope(Singleton.class) .addType(com.crv.jms.Util.createType()) .unremovable() .addQualifier().annotation(Identifier.class).addValue("value", name).done() .createWith( recorder.createSupportedEventTypesList(supportedEventTypes)) .unremovable() .done());
And then specify its need in another syntheticBeanProducer
syntheticBeanProducer.produce( SyntheticBeanBuildItem.configure(EventProducer.class) .addType(EventProducer.class) .scope(Singleton.class) .setRuntimeInit() .addInjectionPoint( com.crv.jms.Util.createType(), AnnotationInstance.builder(Identifier.class).add("value", name).build()) .addQualifier().annotation(Identifier.class).addValue("value", name).done() .createWith(recorder.createParallelEventProducer(name, topicName)) .unremovable() .done());
I would suspect that this would work. however it just gives the error.
[ERROR] HealthCheckTest.testHealth » Runtime java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: jakarta.enterprise.inject.spi.DeploymentException: jakarta.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type java.util.List<java.lang.Class<?>> and qualifiers [@io.smallrye.common.annotation.Identifier("test")]
- synthetic injection point
- declared on SYNTHETIC bean [types=[java.lang.Object, com.crv.jms.EventProducer], qualifiers=[@Any, @io.smallrye.common.annotation.Identifier("test")], target=n/a]
The following beans match by type, but none has matching qualifiers:
- PRODUCER METHOD bean [types=[java.util.List, java.lang.Object], qualifiers=[@Any, @ConfigProperty], target=java.util.List producesListConfigProperty(jakarta.enterprise.inject.spi.InjectionPoint ip), declaringBean=io.smallrye.config.inject.ConfigProducer]
I am suspecting that something is wrong during the generation of the List<Class<?>>. Does anyone have any insights?
Kind regards,
Jelmer
Beta Was this translation helpful? Give feedback.
All reactions