tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup TldConfig.java
Date Wed, 02 Apr 2003 20:03:12 GMT
luehe       2003/04/02 12:03:12

  Modified:    catalina/src/share/org/apache/catalina/startup
                        TldConfig.java
  Log:
  When searching parent class loaders for JAR files (for automatic TLD
  recognition), ignore any JAR files that don't exist
  
  Revision  Changes    Path
  1.5       +21 -11    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/TldConfig.java
  
  Index: TldConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/TldConfig.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TldConfig.java	28 Mar 2003 20:56:15 -0000	1.4
  +++ TldConfig.java	2 Apr 2003 20:03:11 -0000	1.5
  @@ -489,14 +489,13 @@
           } catch (Exception e) {
               // XXX Why do we wrap it ? The signature is 'throws Exception'
               if (name == null) {
  -                    log.error(sm.getString("contextConfig.tldJarException",
  -					   jarPath, context.getPath()),
  -			      e);
  +		log.error(sm.getString("contextConfig.tldJarException",
  +				       jarPath, context.getPath()),
  +			  e);
               } else {
  -                    log.error(sm.getString("contextConfig.tldEntryException",
  -					   name, jarPath,
  -					   context.getPath()),
  -			      e);
  +		log.error(sm.getString("contextConfig.tldEntryException",
  +				       name, jarPath, context.getPath()),
  +			  e);
               }
           } finally {
               if (inputStream != null) {
  @@ -724,19 +723,30 @@
   	    if (loader instanceof URLClassLoader) {
   		URL[] urls = ((URLClassLoader) loader).getURLs();
   		for (int i=0; i<urls.length; i++) {
  +		    JarURLConnection jarConn = null;
   		    URLConnection conn = urls[i].openConnection();
   		    if (conn instanceof JarURLConnection) {
  -			conn.setUseCaches(false);			
  -			globalJarPaths.add((JarURLConnection) conn);
  +			jarConn = (JarURLConnection) conn;
   		    } else {
   			String urlStr = urls[i].toString();
   			if (urlStr.startsWith("file:")
   			        && urlStr.endsWith(".jar")) {
   			    URL jarURL = new URL("jar:" + urlStr + "!/");
  -			    JarURLConnection jarConn = (JarURLConnection)
  -				jarURL.openConnection();
  +			    jarConn = (JarURLConnection) jarURL.openConnection();
  +			}
  +		    }
  +		    if (jarConn != null) {
  +			try {
  +			    /*
  +			     * Call getJarFile() to see if JAR file exists
  +			     * (throws exception in case it doesn't)
  +			     */
  +			    jarConn.getJarFile();
   			    jarConn.setUseCaches(false);
   			    globalJarPaths.add(jarConn);
  +			} catch (Exception e) {
  +			    // Ignore any JAR files that may have been
  +			    // specified on the class path but don't exist
   			}
   		    }
   		}
  
  
  

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


Mime
View raw message