ARC interferes with Smallrye ConfigProducer
See original GitHub issueDescribe the bug
Language: Kotlin
I want to inject a config property of a list of custom types:
@Provider
class TestClass {
@ConfigProperty(name = "property.list")
private lateinit var typeList: List<MyType>
@ConfigProperty(name = "property.single")
private lateinit var singleType: MyType
}
While Smallrye can resolve and fill singleType
, it fails on the list. The cause in the stack trace is:
Caused by: java.lang.IllegalArgumentException: SRCFG02005: Type has no raw type class: io.quarkus.arc.impl.WildcardTypeImpl@2d198533
at io.smallrye.config.inject.ConfigProducerUtil.rawTypeOf(ConfigProducerUtil.java:224)
at io.smallrye.config.inject.ConfigProducerUtil.resolveConverter(ConfigProducerUtil.java:155)
at io.smallrye.config.inject.ConfigProducerUtil.resolveConverter(ConfigProducerUtil.java:149)
at io.smallrye.config.inject.ConfigProducerUtil.resolveConverter(ConfigProducerUtil.java:160)
at io.smallrye.config.inject.ConfigProducerUtil.resolveConverter(ConfigProducerUtil.java:149)
at io.smallrye.config.inject.ConfigProducerUtil.convertValues(ConfigProducerUtil.java:106)
at io.smallrye.config.inject.ConfigProducerUtil.getValue(ConfigProducerUtil.java:76)
at io.smallrye.config.inject.ConfigProducerUtil.getValue(ConfigProducerUtil.java:58)
at io.smallrye.config.inject.ConfigProducer.producesListConfigProperty(ConfigProducer.java:136)
at io.smallrye.config.inject.ConfigProducer_ProducerMethod_producesListConfigProperty_1258131a638f518025054697883e1874162124ce_Bean.create(Unknown Source)
at io.smallrye.config.inject.ConfigProducer_ProducerMethod_producesListConfigProperty_1258131a638f518025054697883e1874162124ce_Bean.get(Unknown Source)
at io.smallrye.config.inject.ConfigProducer_ProducerMethod_producesListConfigProperty_1258131a638f518025054697883e1874162124ce_Bean.get(Unknown Source)
at io.quarkus.arc.impl.CurrentInjectionPointProvider.get(CurrentInjectionPointProvider.java:60)
... 89 more
From what I see, WildcardTypeImpl
provides java.util.List
as rawType
- should it provide the upper bound of actualTypeArgument
?
I tried mitigating it by providing an explizit Converter for List<MyType>
but the result is the same.

Expected behavior
Config Converter for generic type of List<T>
is used.
Actual behavior
Exception and quarkus fails to start.
java.lang.RuntimeException: java.lang.ExceptionInInitializerError
Caused by: java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Failed to start quarkus
at io.quarkus.runner.ApplicationImpl.<clinit>(Unknown Source)
... 48 more
Caused by: java.lang.RuntimeException: Error injecting java.util.List<? extends de.test.MyType> de.test.TestClass. typeList
Caused by: java.lang.IllegalArgumentException: SRCFG02005: Type has no raw type class: io.quarkus.arc.impl.WildcardTypeImpl@2d198533
at io.smallrye.config.inject.ConfigProducerUtil.rawTypeOf(ConfigProducerUtil.java:224)
at io.smallrye.config.inject.ConfigProducerUtil.resolveConverter(ConfigProducerUtil.java:155)
at io.smallrye.config.inject.ConfigProducerUtil.resolveConverter(ConfigProducerUtil.java:149)
at io.smallrye.config.inject.ConfigProducerUtil.resolveConverter(ConfigProducerUtil.java:160)
at io.smallrye.config.inject.ConfigProducerUtil.resolveConverter(ConfigProducerUtil.java:149)
at io.smallrye.config.inject.ConfigProducerUtil.convertValues(ConfigProducerUtil.java:106)
at io.smallrye.config.inject.ConfigProducerUtil.getValue(ConfigProducerUtil.java:76)
at io.smallrye.config.inject.ConfigProducerUtil.getValue(ConfigProducerUtil.java:58)
at io.smallrye.config.inject.ConfigProducer.producesListConfigProperty(ConfigProducer.java:136)
at io.smallrye.config.inject.ConfigProducer_ProducerMethod_producesListConfigProperty_1258131a638f518025054697883e1874162124ce_Bean.create(Unknown Source)
at io.smallrye.config.inject.ConfigProducer_ProducerMethod_producesListConfigProperty_1258131a638f518025054697883e1874162124ce_Bean.get(Unknown Source)
at io.smallrye.config.inject.ConfigProducer_ProducerMethod_producesListConfigProperty_1258131a638f518025054697883e1874162124ce_Bean.get(Unknown Source)
at io.quarkus.arc.impl.CurrentInjectionPointProvider.get(CurrentInjectionPointProvider.java:60)
... 89 more
How to Reproduce?
- Create custom type
- Create Type Converter and add is to
org.eclipse.microprofile.config.spi.Converter
- Create Bean using this type as generic parameter of a list
- Start Quarkus (or a QuarkusTest)
Output of uname -a
or ver
Darwin mymac.local 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64 x86_64
Output of java -version
openjdk version “11.0.16” 2022-07-19 OpenJDK Runtime Environment Temurin-11.0.16+8 (build 11.0.16+8) OpenJDK 64-Bit Server VM Temurin-11.0.16+8 (build 11.0.16+8, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.12.0.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Additional information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
I think it would make sense for SmallRye Config’s
ConfigProducerUtil.rawTypeOf()
to consider an upper bound of a wildcard type as its “raw” type.I’ll have a look.