File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed
exist-core/src/main/java/org/exist/management/client
exist-jetty-config/src/main/resources/webapp/WEB-INF Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -236,10 +236,14 @@ public void init(ServletConfig config) throws ServletException {
236236 }
237237
238238 // Setup token and tokenfile
239- obtainTokenFileReference ();
240-
241- LOG .info ("JMXservlet token: {}" , getToken ());
239+ if (tokenFile == null ) {
240+ tokenFile = dataDir .resolve (TOKEN_FILE );
241+ LOG .info ("Token file: {}" , tokenFile .toAbsolutePath ().toAbsolutePath ());
242+ }
242243
244+ // NOTE(AR) make sure to create the token in init when the servlet is loaded at startup so that it is present for Monex
245+ final String token = getToken ();
246+ LOG .info ("JMXServlet token: {}" , token );
243247 }
244248
245249 /**
@@ -309,17 +313,6 @@ boolean hasSecretToken(HttpServletRequest request, String token) {
309313 return false ;
310314 }
311315
312- /**
313- * Obtain reference to token file
314- */
315- private void obtainTokenFileReference () {
316-
317- if (tokenFile == null ) {
318- tokenFile = dataDir .resolve (TOKEN_FILE );
319- LOG .info ("Token file: {}" , tokenFile .toAbsolutePath ().toAbsolutePath ());
320- }
321- }
322-
323316 /**
324317 * Get token from file, create if not existent. Data is read for each call so the file can be updated run-time.
325318 *
Original file line number Diff line number Diff line change 176176 <servlet >
177177 <servlet-name >JMXServlet</servlet-name >
178178 <servlet-class >org.exist.management.client.JMXServlet</servlet-class >
179+ <!-- NOTE(AR) required for Monex to correctly retrieve the JMX Token
180+ as the JMXServlet has to create it before Monex makes its first request
181+ for the status page
182+ -->
183+ <load-on-startup >3</load-on-startup >
179184 </servlet >
180185
181186 <!--
You can’t perform that action at this time.
0 commit comments