[jboss-jira] [JBoss JIRA] (WFLY-12835) HealthChecks in subdeployments are not registered
charles ghislain (Jira)
issues at jboss.org
Fri May 8 10:43:02 EDT 2020
[ https://issues.redhat.com/browse/WFLY-12835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14085018#comment-14085018 ]
charles ghislain edited comment on WFLY-12835 at 5/8/20 10:42 AM:
------------------------------------------------------------------
This seems related to WFLY-12811 and commit https://github.com/wildfly/wildfly/commit/4f3bc4754216136e19470bdd3a84124a6f9f900a.
The [DeploymentProcessor|https://github.com/wildfly/wildfly/blob/5bad8de7386fe6079429113b935be788329d8e2d/microprofile/health-smallrye/src/main/java/org/wildfly/extension/microprofile/health/deployment/DeploymentProcessor.java] registers a CDIExtension instance for each deployment (sub)module, but only the last one is preserved as only one instance of each extension type may be registered ([WeldPortableExtensions javadoc|https://github.com/wildfly/wildfly/blob/64debb7134598bebb03fccf5509626ed08a6f499/weld/common/src/main/java/org/jboss/as/weld/deployment/WeldPortableExtensions.java]). However, by only registering the extension on parent modules (ei skipping wars when inside ears), the config property is not injected as reported in WFLY-12811.
The real issue seems to be in the [AfterDeploymentValidation listener|https://github.com/wildfly/wildfly/blob/8b321779c6bc17a44f699705985efad0f6a43784/microprofile/health-smallrye/src/main/java/org/wildfly/extension/microprofile/health/deployment/CDIExtension.java#L84], as the injected BeanManager does not resolve healthchecks in the war inside an ear. Strangley, `InitialContext.doLookup("java:comp/BeanManager")` throws a NameNotFoundException there, while `CDI.current().getBeanManager()` returns a beanManager suitable to resolve all healthchecks.
I edited [MicroProfileHealthTestBase|https://github.com/cghislai/wildfly/blob/mp-health-ear/testsuite/integration/microprofile/src/test/java/org/wildfly/test/integration/microprofile/health/MicroProfileHealthTestBase.java] to deploy the war in an ear, and modified the cdi extension as well as the deployment processor to only register a single extension for the parent module, and use CDI.current where JNDI lookup would fail.
Using that change, test fails because of "Required property org.wildfly.test.integration.microprofile.health.MyProbe.propertyConfiguredByTheDeployment not found", but the probes seem correctly resolved.
was (Author: cghislai):
This seems related to WFLY-12811 and commit https://github.com/wildfly/wildfly/commit/4f3bc4754216136e19470bdd3a84124a6f9f900a.
The [DeploymentProcessor|https://github.com/wildfly/wildfly/blob/5bad8de7386fe6079429113b935be788329d8e2d/microprofile/health-smallrye/src/main/java/org/wildfly/extension/microprofile/health/deployment/DeploymentProcessor.java] registers a CDIExtension instance for each deployment (sub)module, but only the last one is preserved as only one instance of each extension type may be registered ([WeldPortableExtensions javadoc|https://github.com/wildfly/wildfly/blob/64debb7134598bebb03fccf5509626ed08a6f499/weld/common/src/main/java/org/jboss/as/weld/deployment/WeldPortableExtensions.java]). However, by only registering the extension on parent modules (ei skipping wars when inside ears), the config property is not injected as reported in WFLY-12811.
The real issue seems to be in the [AfterDeploymentValidation listener|https://github.com/wildfly/wildfly/blob/8b321779c6bc17a44f699705985efad0f6a43784/microprofile/health-smallrye/src/main/java/org/wildfly/extension/microprofile/health/deployment/CDIExtension.java#L84], as the injected BeanManager does not resolve healthchecks in the war inside an ear. Strangley, `InitialContext.doLookup("java:comp/BeanManager")` throws a NameNotFoundException there, while `CDI.current().getBeanManager()` returns a beanManager suitable to resolve all healthchecks.
I edited [MicroProfileHealthTestBase|https://github.com/cghislai/wildfly/blob/mp-health-ear/testsuite/integration/microprofile/src/test/java/org/wildfly/test/integration/microprofile/health/MicroProfileHealthTestBase.java] to deploy the war in an ear. Using that change, test fails because of "Required property org.wildfly.test.integration.microprofile.health.MyProbe.propertyConfiguredByTheDeployment not found", but the probes seem correctly resolved.
> HealthChecks in subdeployments are not registered
> -------------------------------------------------
>
> Key: WFLY-12835
> URL: https://issues.redhat.com/browse/WFLY-12835
> Project: WildFly
> Issue Type: Feature Request
> Components: MP Health
> Affects Versions: 18.0.1.Final
> Reporter: Ivan Straka
> Assignee: Jeff Mesnil
> Priority: Critical
>
> After EAR is deployed HealthChecks are not registered and not exposed under _/health_ endpoint.
> EAR contains one WAR and one JAR. Both of them contains HealthChecks.
> Test source: https://github.com/istraka/eap-microprofile-test-suite/blob/mp-health/microprofile-health/src/test/java/org/jboss/eap/qe/microprofile/health/SubdeploymentHealthTest.java
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list