You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2023/01/04 09:21:49 UTC

[Bug 66409] New: Loading Resources with Blanks in Path Fails

https://bz.apache.org/bugzilla/show_bug.cgi?id=66409

            Bug ID: 66409
           Summary: Loading Resources with Blanks in Path Fails
           Product: Tomcat 9
           Version: 9.0.70
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: michael-christoph.ratzenboeck@cgm.com
  Target Milestone: -----

Since Tomcat 9.0.70, the following problem occurs.

When loading resources (e.g. a font from a jar file) an URISyntaxException is
thrown, if the URI is not valid. However, this also includes URLs which contain
blanks, meaning that loading resources that contain a blank, the resource
cannot be loaded since the determined URL is null.

E.g. Tomcat 7.0.69 was able to load the following resource: "MS Sans
Serif.ttf", whereas Tomcat 7.0.70 is not able to load it anymore, with the
following debug message:

04-Jan-2023 09:56:22.921 FEIN [http-nio-7000-exec-12]
org.apache.catalina.webresources.AbstractArchiveResource.getURL Unable to
determine a URL for the resource
[jar:file:/C:/iheroot/ihe-main-4.2.x/client-web/module/target/ihe.module/WEB-INF/lib/ihe-jasperreports-fonts-4.5.1.jar!/net/sf/jasperreports/fonts/mssansserif/MS
Sans Serif.ttf]
        java.net.URISyntaxException: Illegal character in opaque part at index
108:
jar:file:/C:/module/WEB-INF/lib/ihe-jasperreports-fonts-4.5.1.jar!/net/sf/jasperreports/fonts/mssansserif/MS
Sans Serif.ttf
                at java.net.URI$Parser.fail(URI.java:2847)
                at java.net.URI$Parser.checkChars(URI.java:3020)
                at java.net.URI$Parser.parse(URI.java:3057)
                at java.net.URI.<init>(URI.java:588)
                at
org.apache.catalina.webresources.AbstractArchiveResource.getURL(AbstractArchiveResource.java:144)
                at
org.apache.catalina.webresources.CachedResource.getURL(CachedResource.java:348)
                at
org.apache.catalina.loader.WebappClassLoaderBase.findResource(WebappClassLoaderBase.java:956)
                at
org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1078)

Some investigation on our side showed that
org.apache.cataline.webresources.AbstractArchiveResource#getURL() has changed
from version 7.0.69 to 7.0.70. Instead of using the java.net.URL directly,
java.net.URI(url).toURL() is used now. The problem is, that the URL is not
encoded properly.

The hardware and OS should not influence this bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 66409] Loading Resources with Blanks in Path Fails

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66409

Remy Maucherat <re...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #1 from Remy Maucherat <re...@apache.org> ---


*** This bug has been marked as a duplicate of bug 66388 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org