ctubbsii commented on code in PR #5942:
URL: https://github.com/apache/accumulo/pull/5942#discussion_r2392803758
##########
pom.xml:
##########
@@ -211,7 +211,7 @@ under the License.
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-bom</artifactId>
- <version>9.1.0</version>
+ <version>10.0.0</version>
Review Comment:
The latest appears to be 11.0.0. I don't know the differences between the
two, though. I imagine Jetty is tied to a specific version, but I also wonder
if jetty-servlet would have used 11, and the reason you went with 10 was
because you're using jetty-ee10-servlet instead?
##########
server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java:
##########
@@ -460,15 +459,12 @@ public void run() {
log.info("stop requested. exiting ... ");
}
- private ServletHolder getDefaultServlet() {
- return new ServletHolder(new DefaultServlet() {
- private static final long serialVersionUID = 1L;
-
- @Override
- public Resource getResource(String pathInContext) {
- return Resource.newClassPathResource("/org/apache/accumulo/monitor" +
pathInContext);
- }
- });
+ private ServletHolder getResourcesServlet() {
+ ServletHolder holder = new ServletHolder("resources",
ResourceServlet.class);
+ holder.setInitParameter("dirAllowed", "false");
+ holder.setInitParameter("baseResource", Monitor.class.getClassLoader()
+
.getResource("org/apache/accumulo/monitor/resources").toExternalForm());
Review Comment:
Since the Monitor class is in the `org/apache/accumulo/monitor` package,
this can probably be simplified to a relative resource:
```suggestion
holder.setInitParameter("baseResource",
Monitor.class.getResource("resources")
.toExternalForm());
```
Using the previous `getClassLoader()` form, it should probably be an
absolute resource, starting with `/`, in order to not make any assumptions
about the system classloader's relative resource path resolution.
Also, I don't know if this configuration is actually correct and has
equivalent functionality... I hope so... but would need to test it to see how
it behaves at runtime, since I don't know enough about the ResourceServlet's
behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]