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 getting the following exception after runing a unit test . The same test is OK when using the quarkus's version 1.12.2.Final and 2.2.1.Final .
[ERROR] com.xxx.core.api.CustomerSettingResourceTest.shouldCustomerUserLongIn Time elapsed: 0.018 s <<< ERROR!
java.lang.RuntimeException: java.lang.ExceptionInInitializerError
Caused by: java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Error injecting com.xxx.common.config.XConfig com.xxx.core.security.SecurityContextFilter.applicationConfig
Caused by: java.lang.RuntimeException: Error injecting com.xxx.common.config.XConfig com.xxx.core.security.SecurityContextFilter.applicationConfig
Caused by: java.util.NoSuchElementException: SRCFG00027: Could not find a mapping for com.xxx.common.config.XConfig
mybe the issue is related to the fact that com.xxx.core.security.SecurityContextFilter implements javax.ws.rs.container.ContainerRequestFilter
NB: The exception is not raised when using the quarkus's version 2.2.1.Final ( the regression is present in 2.2.2.Final, 2.2.3.Final and 2.3.0.Final)
Expected behavior
Be able to inject configuration inside a ContainerRequestFilter provider
Actual behavior
Configuration is not injected an exception is raised
How to Reproduce?
please clone the following repo : https://github.com/emiste/quarkus.git
run ./mvn install inside the folder reproducer-20257-with-quarkus-2.2.3.Final to get the exception
run ./mvn install inside the folder reproducer-20257-with-quarkus-2.2.1.Final to get build success
Output of uname -a or ver
No response
Output of java -version
java 11.0.4 2019-07-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)
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)
@emiste this is working, but you need to annotate your @ConfigMapping with @StaticInitSafe. Adding the annotation the code works as expected.
The reason for this is because JAX-RS providers initialize during static init and we don't automatically register discovered sources or mappings in static init. Please check https://quarkus.io/guides/config-mappings#registration.
Describe the bug
I'm getting the following exception after runing a unit test . The same test is OK when using the quarkus's version 1.12.2.Final and 2.2.1.Final .
[ERROR] com.xxx.core.api.CustomerSettingResourceTest.shouldCustomerUserLongIn Time elapsed: 0.018 s <<< ERROR!
java.lang.RuntimeException: java.lang.ExceptionInInitializerError
Caused by: java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Error injecting com.xxx.common.config.XConfig com.xxx.core.security.SecurityContextFilter.applicationConfig
Caused by: java.lang.RuntimeException: Error injecting com.xxx.common.config.XConfig com.xxx.core.security.SecurityContextFilter.applicationConfig
Caused by: java.util.NoSuchElementException: SRCFG00027: Could not find a mapping for com.xxx.common.config.XConfig
mybe the issue is related to the fact that com.xxx.core.security.SecurityContextFilter implements javax.ws.rs.container.ContainerRequestFilter
NB: The exception is not raised when using the quarkus's version 2.2.1.Final ( the regression is present in 2.2.2.Final, 2.2.3.Final and 2.3.0.Final)
Expected behavior
Be able to inject configuration inside a ContainerRequestFilter provider
Actual behavior
Configuration is not injected an exception is raised
How to Reproduce?
please clone the following repo : https://github.com/emiste/quarkus.git
run ./mvn install inside the folder reproducer-20257-with-quarkus-2.2.3.Final to get the exception
run ./mvn install inside the folder reproducer-20257-with-quarkus-2.2.1.Final to get build success
Output of
uname -a
orver
No response
Output of
java -version
java 11.0.4 2019-07-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven home: C:\Users\xxx.m2\wrapper\dists\apache-maven-3.8.1-bin\2l5mhf2pq2clrde7f7qp1rdt5m\apache-maven-3.8.1 Java version: 11.0.4, vendor: Oracle Corporation, runtime: C:\tools\Java\jdk-11.0.4 Default locale: fr_FR, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Additional information
The exception is not raised when using the quarkus's version 2.2.1.Final ( the regression is present in 2.2.2.Final , 2.2.3.Final and 2.3.0.Final)
The text was updated successfully, but these errors were encountered: