Author: markt Date: Tue May 3 08:47:00 2016 New Revision: 1742071 URL: http://svn.apache.org/viewvc?rev=1742071&view=rev Log: Use the correct URL for the fragment when reporting errors processing a web-fragment.xml file from a JAR located in an unpacked WAR.
Modified: tomcat/trunk/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java?rev=1742071&r1=1742070&r2=1742071&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java Tue May 3 08:47:00 2016 @@ -55,7 +55,6 @@ public class FragmentJarScannerCallback throws IOException { URL url = jarConn.getURL(); - URL resourceURL = jarConn.getJarFileURL(); Jar jar = null; InputStream is = null; WebXml fragment = new WebXml(); @@ -77,8 +76,9 @@ public class FragmentJarScannerCallback // distributable fragment.setDistributable(true); } else { - InputSource source = new InputSource( - "jar:" + resourceURL.toString() + "!/" + FRAGMENT_LOCATION); + @SuppressWarnings("null") // Cannot be null here + String fragmentUrl = jar.getURL(FRAGMENT_LOCATION); + InputSource source = new InputSource(fragmentUrl); source.setByteStream(is); if (!webXmlParser.parseWebXml(source, fragment, true)) { ok = false; Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1742071&r1=1742070&r2=1742071&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Tue May 3 08:47:00 2016 @@ -165,6 +165,11 @@ <code>HttpServletRequest.getRequestURI()</code> returns an encoded URI rather than a decoded URI after a dispatch. (markt) </fix> + <fix> + Use the correct URL for the fragment when reporting errors processing + a <code>web-fragment.xml</code> file from a JAR located in an unpacked + WAR. (markt) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org