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 {
236
236
}
237
237
238
238
// 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
+ }
242
243
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 );
243
247
}
244
248
245
249
/**
@@ -309,17 +313,6 @@ boolean hasSecretToken(HttpServletRequest request, String token) {
309
313
return false ;
310
314
}
311
315
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
-
323
316
/**
324
317
* Get token from file, create if not existent. Data is read for each call so the file can be updated run-time.
325
318
*
Original file line number Diff line number Diff line change 176
176
<servlet >
177
177
<servlet-name >JMXServlet</servlet-name >
178
178
<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 >
179
184
</servlet >
180
185
181
186
<!--
You can’t perform that action at this time.
0 commit comments