You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2024/01/17 16:10:09 UTC

(causeway) branch CAUSEWAY-3678 created (now 32ba3aefda)

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

danhaywood pushed a change to branch CAUSEWAY-3678
in repository https://gitbox.apache.org/repos/asf/causeway.git


      at 32ba3aefda CAUSEWAY-3678: adds guard into RO's filter

This branch includes the following new commits:

     new 32ba3aefda CAUSEWAY-3678: adds guard into RO's filter

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(causeway) 01/01: CAUSEWAY-3678: adds guard into RO's filter

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-3678
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 32ba3aefda6444ff9318976685dd3f52f268f502
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jan 17 16:08:54 2024 +0000

    CAUSEWAY-3678: adds guard into RO's filter
---
 .../webmodule/CausewayRestfulObjectsInteractionFilter.java     | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/viewers/restfulobjects/viewer/src/main/java/org/apache/causeway/viewer/restfulobjects/viewer/webmodule/CausewayRestfulObjectsInteractionFilter.java b/viewers/restfulobjects/viewer/src/main/java/org/apache/causeway/viewer/restfulobjects/viewer/webmodule/CausewayRestfulObjectsInteractionFilter.java
index 80caded0d9..3fb9d46308 100644
--- a/viewers/restfulobjects/viewer/src/main/java/org/apache/causeway/viewer/restfulobjects/viewer/webmodule/CausewayRestfulObjectsInteractionFilter.java
+++ b/viewers/restfulobjects/viewer/src/main/java/org/apache/causeway/viewer/restfulobjects/viewer/webmodule/CausewayRestfulObjectsInteractionFilter.java
@@ -347,11 +347,17 @@ public class CausewayRestfulObjectsInteractionFilter implements Filter {
         Objects.requireNonNull(interactionService, "causewayInteractionFactory");
         Objects.requireNonNull(specificationLoader, "specificationLoader");
 
-        ensureMetamodelIsValid(specificationLoader);
-
         val httpServletRequest = (HttpServletRequest) request;
         val httpServletResponse = (HttpServletResponse) response;
 
+        // check that the app has bootstrapped; if it hasn't, then return a 503 (rather than a huge stack trace)
+        try {
+            ensureMetamodelIsValid(specificationLoader);
+        } catch (Exception ex) {
+            httpServletResponse.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
+            return;
+        }
+
         try {
             val queryString = httpServletRequest.getQueryString();
             if (queryString != null && queryString