From 5d7d2c54aa19ab3df74c264c63acfdf0808fac7a Mon Sep 17 00:00:00 2001 From: Jean-Louis Monteiro Date: Wed, 22 Nov 2023 13:04:01 +0100 Subject: [PATCH] feat(#TOMEE-4281): Try to also catch the getClasses from application --- .../org/apache/openejb/config/AnnotationDeployer.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java b/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java index 1f5beda408c..903f67a6051 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java @@ -2251,11 +2251,10 @@ public WebModule deploy(final WebModule webModule) throws OpenEJBException { } else { addRestClassesToScannedClasses(webModule, classes, classLoader); } - } catch (final RuntimeException npe) { - if (app == null) { - throw npe; - } - // if app depends on cdi no need to do it + } catch (final NoClassDefFoundError e) { + logger.debug("Could not load REST classes for application {1} for module {2} / {3}", + application, webModule.getJarLocation(), webModule.getFile().getName()); + throw new OpenEJBException("Unable to load REST classes for application: " + application, e); } } catch (final InstantiationException e) { throw new OpenEJBException("Unable to instantiate Application class: " + application, e);