diff --git a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/ui/FMod_UI.java b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/ui/FMod_UI.java index ff280dc35c7..09e6cc3635f 100644 --- a/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/ui/FMod_UI.java +++ b/jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/mod/ui/FMod_UI.java @@ -64,7 +64,8 @@ public FMod_UI() {} private static ArgDecl argUIFiles = new ArgDecl(true, "ui"); /** Java resource name used to find the UI files. */ - private static String resourceNameUI = "webapp"; + private static String resourceNameUI = "/webapp/index.html"; + private static String resourceBaseNameUI = "/webapp"; /** Directory name of the root of UI files */ private static String directoryNameUI = "webapp"; @@ -153,7 +154,7 @@ private String findFusekiApp(FusekiServerCtl serverCtl) { // 3:: From a jar. // Format jar:file:///.../jena-fuseki-ui-VERSION.jar!/webapp/" - String r = fromClasspath(resourceNameUI); + String r = fromClasspath(resourceNameUI, resourceBaseNameUI); if ( r != null ) { // Simplify name. String displayName = loggingName(r); @@ -165,16 +166,22 @@ private String findFusekiApp(FusekiServerCtl serverCtl) { } // Look for "$resourceName" on the classpath. - private static String fromClasspath(String resourceName) { + private static String fromClasspath(String lookupName, String rootName) { // Jetty 12.0.15 => warning "Leaked mount" // Logger : "org.eclipse.jetty.util.resource.ResourceFactory" //ResourceFactory resourceFactory = ResourceFactory.root(); - ResourceFactory resourceFactory = ResourceFactory.closeable(); - Resource resource = resourceFactory.newClassLoaderResource(resourceName); - if ( resource != null ) - return resource.getURI().toString(); - return null; + // Jetty 12.1.9: Need to lookup the name of a resource (lookup name), not the directory (rootName) + try ( ResourceFactory.Closeable resourceFactory = ResourceFactory.closeable() ) { + Resource resource = resourceFactory.newClassLoaderResource(lookupName); + if ( resource == null ) + return null; + String x = resource.getURI().toString(); + int i = x.indexOf(rootName); + // Up to the rootName + x = x.substring(0, i + rootName.length()); + return x; + } } // Look for "$path/$resourceName" diff --git a/pom.xml b/pom.xml index 48fbed70e26..aad4ba42287 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 2.0.1 - 12.1.8 + 12.1.9 6.1.0