https://issues.apache.org/bugzilla/show_bug.cgi?id=52329

             Bug #: 52329
           Summary: URI has a fragment component
           Product: Tomcat 7
           Version: 7.0.23
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: ferdinand_dos...@yahoo.co.uk
    Classification: Unclassified


I have Tomcat 7 embedded in a application in which the jndi protocol is already
registered.
(see URL.setURLStreamHandlerFactory(URLStreamHandlerFactory fac) )

So, Tomcat fails to register his own and turns to protocol file:/ to lookup
resources.

The issue comes when there is a multiple level context (example: /test/myapp).
Tomcat expands the war under the directory webapps such as:
<tomcat_dir>/webapps/test#myapp/

When Tomcat looks up for resources, the url is malformed:
<tomat_dir>/webapps/test#myapp/WEB-INF/...
the part #myapp/WEB-INF/... is considered as a fragment

StackTrace:
java.lang.IllegalArgumentException: URI has a fragment component
    at java.io.File.<init>(Unknown Source)
    at
org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1813)
    at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1203)
    at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:828)
    at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:302)
    at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5148)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)



My solution was to replace the FWD_SLASH_REPLACEMENT (#) by '~' in the
org.apache.catalina.util.ContextName class in catalina.jar

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to