Custom Microprofile Config Source WAR / EAR

219 views
Skip to first unread message

Bruno

unread,
Jan 3, 2022, 7:19:21 AM1/3/22
to SmallRye
Greetings,

I have successfully used a custom Microprofile Config Source inside a WAR file deployed to Wildfly, but when the same WAR is deployed inside an EAR file I get the following error:

Caused by: io.smallrye.config.inject.ConfigException: No Config Value exists for required property dummy
        at io.smallrye.config//io.smallrye.config.inject.ConfigExtension.validate(ConfigExtension.java:104)
        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 org.jboss...@3.1.5.Final//org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)

I much appreciate any help pointing to whatever is missing in the EAR file. I have tried to debug and it seams SmallRyeConfigProviderResolver is able to pick up the custom config source but for whatever reason it will not be included in the known config sources.

I have attached two files:
  • service-1.0.war - contains a custom config source and a REST webservice where a "dummy" property is injected (made available by the custom config source);
  • custom-config-1.0.ear - an EAR with the the exact same WAR file but in this form it is not able to resolve the "dummy" property.
Wildfly version: 21.0.2.Final

Thanks,
Bruno
service-1.0.war
custom-config-1.0.ear

Martin Stefanko

unread,
Jan 3, 2022, 9:16:52 AM1/3/22
to SmallRye
Hi, I believe this will be a problem in classloading differences between wars and ears in WildFly, not a problem in SmallRye. However, when I tried to deploy your services on WFLY I got the following error: Caused by: java.lang.AbstractMethodError: Receiver class org.example.CustomConfigSource does not define or inherit an implementation of the resolved method 'abstract java.util.Set getPropertyNames()' of interface org.eclipse.microprofile.config.spi.ConfigSource.

Cheers,
Martin

Gunnar Hilling

unread,
Jan 31, 2022, 4:49:10 AM1/31/22
to SmallRye
Isn't this a more general problem? AFAIK Microprofile only defines war-deployments, correct? I have a similar project situation and I'd like to migrate my JEE application to mp (config, health) but ATM this is a dangerous game because it's not sure what is and will be supported.
I'd love to stand corrected, however...
Kind regards,
Gunnar

Martin Stefanko

unread,
Jan 31, 2022, 5:47:58 AM1/31/22
to SmallRye
Yes, you are correct. MicroProfile is not specifying behavior for EARs. Actually, in the productized version of Wildfly -> EAP, you can only use MicroProfile in the EAP XP (expansion pack) in which EAR packaging is not supported.

Supporting Config or Health in EARs would need to be done with some caveats - https://issues.redhat.com/browse/WFLY-12835?focusedCommentId=14115173&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14115173. However, the issue is still open and on my todo list to check.

Reply all
Reply to author
Forward
0 new messages