This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomee.git


The following commit(s) were added to refs/heads/main by this push:
     new 728aab6c56 Improve failed startup follow-up exceptions and back to OWB 
snapshot (#1093)
728aab6c56 is described below

commit 728aab6c56081863b61ab362a5279575b4253b91
Author: Thomas Andraschko <[email protected]>
AuthorDate: Tue Jan 16 09:24:21 2024 +0100

    Improve failed startup follow-up exceptions and back to OWB snapshot (#1093)
---
 pom.xml                                                            | 2 +-
 .../org/apache/tomee/microprofile/health/MPHealthCDIExtension.java | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4d726ac80d..729c2bc8a5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -218,7 +218,7 @@
     <version.johnzon>2.0.0</version.johnzon>
     <version.myfaces>4.0.1</version.myfaces>
     <version.openjpa>4.0.0-SNAPSHOT</version.openjpa>
-    <version.openwebbeans>4.0.1</version.openwebbeans>
+    <version.openwebbeans>4.0.2-SNAPSHOT</version.openwebbeans>
     <!-- org.eclipse -->
     <version.eclipselink>3.0.4</version.eclipselink>
     <!-- org.glassfish -->
diff --git 
a/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/health/MPHealthCDIExtension.java
 
b/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/health/MPHealthCDIExtension.java
index f205a29dd9..2151c72b08 100644
--- 
a/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/health/MPHealthCDIExtension.java
+++ 
b/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/health/MPHealthCDIExtension.java
@@ -121,6 +121,11 @@ public class MPHealthCDIExtension implements Extension {
      * Remove all the instances of {@link HealthCheck} from the {@link 
MicroProfileHealthReporter}.
      */
     public void beforeShutdown(@Observes final BeforeShutdown bs) {
+        // in case when CDI startup failed
+        if (reporter == null)
+        {
+            return;
+        }
         removeHealthCheck(livenessChecks, reporter::removeLivenessCheck);
         removeHealthCheck(readinessChecks, reporter::removeReadinessCheck);
         removeHealthCheck(startupChecks, reporter::removeStartupCheck);
@@ -182,4 +187,4 @@ public class MPHealthCDIExtension implements Extension {
                 .build();
         }
     }
-}
\ No newline at end of file
+}

Reply via email to