Openboxes not as submap but in root

Hi,

I was figuring out how to load openboxes directly without the usage of the submap.
So instead of http://mydomainname.com/openboxeshttp://mydomainname.com

I used this code:

<Host name="localhost" appBase="webapps" unpackWARs="true"
   autoDeploy="false" deployOnStartup="false">
     <Context path="" docBase="openboxes"></Context>
 
     <!-- Further settings for localhost -->
</Host>

All page load perfect except the index page (main page). I get a white page. I see for about 1 second that the footer loads then it skips to white page.
The log file (catalina.out) only shows this:

2022-01-13 17:46:36,409 [http-bio-10.0.0.2-8085-exec-3] INFO filters.SecurityFilters - dashboard.index: [user:admin, location:Kleding Magazijn Brunssum]
2022-01-13 17:46:36,418 [http-bio-10.0.0.2-8085-exec-3] INFO filters.SecurityFilters - Request duration for (dashboard/index): 8ms/1ms
2022-01-13 17:46:36,673 [http-bio-10.0.0.2-8085-exec-8] INFO filters.SecurityFilters - errors.handleNotFound: [user:admin, location:Kleding Magazijn Brunssum]
2022-01-13 17:46:36,674 [http-bio-10.0.0.2-8085-exec-8] INFO core.ErrorsController - Params [action:handleNotFound, controller:errors]
2022-01-13 17:46:36,683 [http-bio-10.0.0.2-8085-exec-3] INFO filters.SecurityFilters - errors.handleNotFound: [user:admin, location:Kleding Magazijn Brunssum]
2022-01-13 17:46:36,683 [http-bio-10.0.0.2-8085-exec-3] INFO core.ErrorsController - Params [action:handleNotFound, controller:errors]
2022-01-13 17:46:36,710 [http-bio-10.0.0.2-8085-exec-8] INFO filters.SecurityFilters - Request duration for (errors/handleNotFound): 1ms/36ms
2022-01-13 17:46:36,713 [http-bio-10.0.0.2-8085-exec-1] INFO filters.SecurityFilters - errors.handleNotFound: [user:admin, location:Kleding Magazijn Brunssum]
2022-01-13 17:46:36,714 [http-bio-10.0.0.2-8085-exec-1] INFO core.ErrorsController - Params [action:handleNotFound, controller:errors]
2022-01-13 17:46:36,717 [http-bio-10.0.0.2-8085-exec-5] INFO filters.SecurityFilters - errors.handleNotFound: [user:admin, location:Kleding Magazijn Brunssum]
2022-01-13 17:46:36,717 [http-bio-10.0.0.2-8085-exec-5] INFO core.ErrorsController - Params [action:handleNotFound, controller:errors]
2022-01-13 17:46:36,727 [http-bio-10.0.0.2-8085-exec-1] INFO filters.SecurityFilters - Request duration for (errors/handleNotFound): 1ms/13ms
2022-01-13 17:46:36,736 [http-bio-10.0.0.2-8085-exec-5] INFO filters.SecurityFilters - Request duration for (errors/handleNotFound): 0ms/19ms
2022-01-13 17:46:36,738 [http-bio-10.0.0.2-8085-exec-3] INFO filters.SecurityFilters - Request duration for (errors/handleNotFound): 1ms/54ms
2022-01-13 17:46:36,744 [http-bio-10.0.0.2-8085-exec-10] INFO filters.SecurityFilters - errors.handleNotFound: [user:admin, location:Kleding Magazijn Brunssum]
2022-01-13 17:46:36,745 [http-bio-10.0.0.2-8085-exec-10] INFO core.ErrorsController - Params [action:handleNotFound, controller:errors]
2022-01-13 17:46:36,748 [http-bio-10.0.0.2-8085-exec-6] INFO filters.SecurityFilters - errors.handleNotFound: [user:admin, location:Kleding Magazijn Brunssum]
2022-01-13 17:46:36,748 [http-bio-10.0.0.2-8085-exec-6] INFO core.ErrorsController - Params [action:handleNotFound, controller:errors]
2022-01-13 17:46:36,773 [http-bio-10.0.0.2-8085-exec-10] INFO filters.SecurityFilters - Request duration for (errors/handleNotFound): 1ms/27ms
2022-01-13 17:46:36,791 [http-bio-10.0.0.2-8085-exec-6] INFO filters.SecurityFilters - Request duration for (errors/handleNotFound): 1ms/42ms
2022-01-13 17:46:36,815 [http-bio-10.0.0.2-8085-exec-1] INFO web.Timer - Cached request for /grails/dashboard/megamenu.dispatch took 0:00:00.001
2022-01-13 17:46:36,822 [http-bio-10.0.0.2-8085-exec-5] INFO web.Timer - Cached request for /grails/dashboard/megamenu.dispatch took 0:00:00.000
2022-01-13 17:46:36,823 [http-bio-10.0.0.2-8085-exec-8] INFO web.Timer - Cached request for /grails/dashboard/megamenu.dispatch took 0:00:00.001
2022-01-13 17:46:36,844 [http-bio-10.0.0.2-8085-exec-1] INFO core.UserService - Is role ROLE_FINANCE in [ROLE_SUPERUSER, ROLE_ADMIN] = false
2022-01-13 17:46:36,844 [http-bio-10.0.0.2-8085-exec-1] INFO core.UserService - Is role ROLE_ASSISTANT in [ROLE_SUPERUSER, ROLE_ADMIN] = false
2022-01-13 17:46:36,844 [http-bio-10.0.0.2-8085-exec-1] INFO core.UserService - Is role ROLE_ADMIN in [ROLE_SUPERUSER, ROLE_ADMIN] = true
2022-01-13 17:46:36,864 [http-bio-10.0.0.2-8085-exec-5] INFO core.UserService - Is role ROLE_INVOICE in [ROLE_SUPERUSER, ROLE_ADMIN] = false
2022-01-13 17:46:36,865 [http-bio-10.0.0.2-8085-exec-5] INFO core.UserService - Is role ROLE_ASSISTANT in [ROLE_SUPERUSER, ROLE_ADMIN] = false
2022-01-13 17:46:36,865 [http-bio-10.0.0.2-8085-exec-5] INFO core.UserService - Is role ROLE_SUPERUSER in [ROLE_SUPERUSER, ROLE_ADMIN] = true
2022-01-13 17:46:36,870 [http-bio-10.0.0.2-8085-exec-8] INFO core.UserService - Is role ROLE_FINANCE in [ROLE_SUPERUSER, ROLE_ADMIN] = false
2022-01-13 17:46:36,870 [http-bio-10.0.0.2-8085-exec-8] INFO core.UserService - Is role ROLE_MANAGER in [ROLE_SUPERUSER, ROLE_ADMIN] = false
2022-01-13 17:46:36,870 [http-bio-10.0.0.2-8085-exec-8] INFO core.UserService - Is role ROLE_ASSISTANT in [ROLE_SUPERUSER, ROLE_ADMIN] = false
2022-01-13 17:46:36,870 [http-bio-10.0.0.2-8085-exec-8] INFO core.UserService - Is role ROLE_ADMIN in [ROLE_SUPERUSER, ROLE_ADMIN] = true
2022-01-13 17:46:36,892 [http-bio-10.0.0.2-8085-exec-6] INFO web.Timer - Cached request for /grails/dashboard/megamenu.dispatch took 0:00:00.001
2022-01-13 17:46:36,903 [http-bio-10.0.0.2-8085-exec-6] INFO core.UserService - Is role ROLE_MANAGER in [ROLE_SUPERUSER, ROLE_ADMIN] = false
2022-01-13 17:46:36,903 [http-bio-10.0.0.2-8085-exec-6] INFO core.UserService - Is role ROLE_ASSISTANT in [ROLE_SUPERUSER, ROLE_ADMIN] = false
2022-01-13 17:46:36,903 [http-bio-10.0.0.2-8085-exec-6] INFO core.UserService - Is role ROLE_ADMIN in [ROLE_SUPERUSER, ROLE_ADMIN] = true
2022-01-13 17:46:36,911 [http-bio-10.0.0.2-8085-exec-10] INFO web.Timer - Cached request for /grails/dashboard/megamenu.dispatch took 0:00:00.001
2022-01-13 17:46:36,923 [http-bio-10.0.0.2-8085-exec-3] INFO web.Timer - Cached request for /grails/dashboard/megamenu.dispatch took 0:00:00.001
2022-01-13 17:46:36,923 [http-bio-10.0.0.2-8085-exec-10] INFO core.UserService - Is role ROLE_MANAGER in [ROLE_SUPERUSER, ROLE_ADMIN] = false
2022-01-13 17:46:36,923 [http-bio-10.0.0.2-8085-exec-10] INFO core.UserService - Is role ROLE_ADMIN in [ROLE_SUPERUSER, ROLE_ADMIN] = true
2022-01-13 17:46:36,928 [http-bio-10.0.0.2-8085-exec-1] INFO filters.SecurityFilters - errors.handleNotFound: [user:admin, location:Kleding Magazijn Brunssum]
2022-01-13 17:46:36,929 [http-bio-10.0.0.2-8085-exec-1] INFO core.ErrorsController - Params [action:handleNotFound, controller:errors]
2022-01-13 17:46:36,930 [http-bio-10.0.0.2-8085-exec-1] INFO filters.SecurityFilters - Request duration for (errors/handleNotFound): 1ms/1ms
2022-01-13 17:46:36,935 [http-bio-10.0.0.2-8085-exec-3] INFO core.UserService - Is role ROLE_ADMIN in [ROLE_SUPERUSER, ROLE_ADMIN] = true
2022-01-13 17:46:37,003 [http-bio-10.0.0.2-8085-exec-10] INFO filters.SecurityFilters - errors.handleNotFound: [user:admin, location:Kleding Magazijn Brunssum]
2022-01-13 17:46:37,003 [http-bio-10.0.0.2-8085-exec-10] INFO core.ErrorsController - Params [action:handleNotFound, controller:errors]
2022-01-13 17:46:37,013 [http-bio-10.0.0.2-8085-exec-10] INFO filters.SecurityFilters - Request duration for (errors/handleNotFound): 1ms/9ms
2022-01-13 17:46:37,043 [http-bio-10.0.0.2-8085-exec-10] INFO web.Timer - Cached request for /grails/dashboard/megamenu.dispatch took 0:00:00.001
2022-01-13 17:46:37,051 [http-bio-10.0.0.2-8085-exec-10] INFO core.UserService - Is role ROLE_SUPERUSER in [ROLE_SUPERUSER, ROLE_ADMIN] = true

The context path (submap) is hard-coded throughout the application, especially the base API URL used in the React pages. And unfortunately, this is not something that we can change without a major refactoring.

We started down this path during our Grails 3 migration, but that project has been on pause for the last year as we finish up some large implementations. We’re hoping to get back to it in the next few months.

In the meantime, I’m not sure what to recommend but I’ll include some details on how we investigated the problem Log in with Atlassian account

Here’s the original ticket (included below as a PDF since this jira instance is not public)
OBGM-141.pdf (329.8 KB)

As well as how we eventually solved the problem. Here are some commits for that feature request just to show you how involved it is.

From what I remember I did not love this solution because it requires the application (WAR) to know the context path at build time. In other words, I don’t think there’s a way to configure this for both the frontend and backend at runtime since the react app is embedded in the WAR file. I could be wrong though.

I would rather find a solution that allows the app to change it’s base URL at runtime (i.e. by deploying the war under ROOT.war, some other appname or changing the Tomcat configuration like you did). And as far as I know that might only be possible by splitting the applications into two separate deployable apps (React frontend vs Grails server-side).

Thanks for the reply. So wrapping up… there is currently no way to change the map name or to load the app from the root dir?

Other solution would be apache with a proxy maybe.

Unfortunately there’s no way to do it without significant code changes.

Thanks, for now no problem. :slight_smile: