Author: remy.maucherat(a)jboss.com
Date: 2009-06-06 18:34:44 -0400 (Sat, 06 Jun 2009)
New Revision: 1090
Removed:
trunk/java/org/apache/catalina/startup/WarScanner.java
trunk/java/org/apache/tomcat/WarComponents.java
Modified:
trunk/conf/server.xml
trunk/java/org/apache/catalina/startup/ContextConfig.java
trunk/res/confinstall/server_2.xml
Log:
- Remove dead code.
Modified: trunk/conf/server.xml
===================================================================
--- trunk/conf/server.xml 2009-06-06 22:23:25 UTC (rev 1089)
+++ trunk/conf/server.xml 2009-06-06 22:34:44 UTC (rev 1090)
@@ -66,8 +66,7 @@
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
- unpackWARs="true" autoDeploy="true"
- xmlValidation="false" xmlNamespaceAware="false">
+ unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-06-06 22:23:25 UTC (rev
1089)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-06-06 22:34:44 UTC (rev
1090)
@@ -112,7 +112,6 @@
import org.apache.catalina.util.StringManager;
import org.apache.naming.resources.JARDirContext;
import org.apache.naming.resources.ProxyDirContext;
-import org.apache.tomcat.WarComponents;
import org.apache.tomcat.util.digester.Digester;
import org.apache.tomcat.util.digester.RuleSet;
import org.xml.sax.ErrorHandler;
@@ -129,7 +128,7 @@
*/
public class ContextConfig
- implements LifecycleListener, WarComponents {
+ implements LifecycleListener {
protected static org.jboss.logging.Logger log=
org.jboss.logging.Logger.getLogger( ContextConfig.class );
@@ -267,8 +266,8 @@
* Used to speed up scanning for the services interest classes.
*/
protected Class<?>[] handlesTypesArray = null;
- protected Map<Class<?>, ServletContainerInitializerInfoImpl> handlesTypes
=
- new HashMap<Class<?>, ServletContainerInitializerInfoImpl>();
+ protected Map<Class<?>, ServletContainerInitializerInfo> handlesTypes =
+ new HashMap<Class<?>, ServletContainerInitializerInfo>();
// ------------------------------------------------------------- Properties
@@ -1332,7 +1331,7 @@
if (handlesTypesArray != null) {
for (int i = 0; i < handlesTypesArray.length; i++) {
if (handlesTypesArray[i].isAssignableFrom(clazz)) {
- ServletContainerInitializerInfoImpl
jarServletContainerInitializerService =
+ ServletContainerInitializerInfo
jarServletContainerInitializerService =
handlesTypes.get(handlesTypesArray[i]);
jarServletContainerInitializerService.addStartupNotifyClass(clazz);
}
@@ -1437,8 +1436,8 @@
}
}
// Add in jarService map, and add in the local map used to speed up lookups
- ServletContainerInitializerInfoImpl jarServletContainerInitializerService =
- new ServletContainerInitializerInfoImpl(servletContainerInitializerClass,
handlesTypesArray);
+ ServletContainerInitializerInfo jarServletContainerInitializerService =
+ new ServletContainerInitializerInfo(servletContainerInitializerClass,
handlesTypesArray);
servletContainerInitializerInfos.put(file.getName(),
jarServletContainerInitializerService);
if (typesArray != null) {
ArrayList<Class<?>> handlesTypesList = new
ArrayList<Class<?>>();
@@ -2186,11 +2185,11 @@
}
- protected class ServletContainerInitializerInfoImpl implements
ServletContainerInitializerInfo {
+ protected class ServletContainerInitializerInfo {
protected Class<?> servletContainerInitializer = null;
protected Class<?>[] interestClasses = null;
protected HashSet<Class<?>> startupNotifySet = new
HashSet<Class<?>>();
- protected ServletContainerInitializerInfoImpl(Class<?>
servletContainerInitializer, Class<?>[] interestClasses) {
+ protected ServletContainerInitializerInfo(Class<?>
servletContainerInitializer, Class<?>[] interestClasses) {
this.servletContainerInitializer = servletContainerInitializer;
this.interestClasses = interestClasses;
}
Deleted: trunk/java/org/apache/catalina/startup/WarScanner.java
===================================================================
--- trunk/java/org/apache/catalina/startup/WarScanner.java 2009-06-06 22:23:25 UTC (rev
1089)
+++ trunk/java/org/apache/catalina/startup/WarScanner.java 2009-06-06 22:34:44 UTC (rev
1090)
@@ -1,722 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- *
- *
- * This file incorporates work covered by the following copyright and
- * permission notice:
- *
- * Copyright 1999-2009 The Apache Software Foundation
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *
http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.catalina.startup;
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-import javax.naming.NameClassPair;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.DirContext;
-import javax.servlet.ServletException;
-
-import org.apache.catalina.Context;
-import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.util.StringManager;
-import org.apache.tomcat.util.digester.Digester;
-import org.xml.sax.InputSource;
-
-/**
- * Startup event listener for a <b>Context</b> that configures the
properties
- * of that Context, and the associated defined servlets.
- *
- * @author Craig R. McClanahan
- * @author Jean-Francois Arcand
- * @author Costin Manolache
- * @author Remy Maucherat
- * @deprecated No longer used
- */
-public final class WarScanner {
-
- private static org.jboss.logging.Logger log=
- org.jboss.logging.Logger.getLogger(WarScanner.class);
-
- /**
- * Names of JARs that are known not to contain any descriptors.
- */
- private static HashSet<String> noDescriptorsJars;
-
- /**
- * Initializes the set of JARs that are known not to contain any descriptors.
- */
- static {
- noDescriptorsJars = new HashSet<String>();
- // Bootstrap JARs
- noDescriptorsJars.add("bootstrap.jar");
- noDescriptorsJars.add("commons-daemon.jar");
- noDescriptorsJars.add("tomcat-juli.jar");
- // Main JARs
- noDescriptorsJars.add("annotations-api.jar");
- noDescriptorsJars.add("catalina.jar");
- noDescriptorsJars.add("catalina-ant.jar");
- noDescriptorsJars.add("el-api.jar");
- noDescriptorsJars.add("jasper.jar");
- noDescriptorsJars.add("jasper-el.jar");
- noDescriptorsJars.add("jasper-jdt.jar");
- noDescriptorsJars.add("jsp-api.jar");
- noDescriptorsJars.add("servlet-api.jar");
- noDescriptorsJars.add("tomcat-coyote.jar");
- noDescriptorsJars.add("tomcat-dbcp.jar");
- // i18n JARs
- noDescriptorsJars.add("tomcat-i18n-en.jar");
- noDescriptorsJars.add("tomcat-i18n-es.jar");
- noDescriptorsJars.add("tomcat-i18n-fr.jar");
- noDescriptorsJars.add("tomcat-i18n-ja.jar");
- // Misc JARs not included with Tomcat
- noDescriptorsJars.add("ant.jar");
- noDescriptorsJars.add("commons-dbcp.jar");
- noDescriptorsJars.add("commons-beanutils.jar");
- noDescriptorsJars.add("commons-fileupload-1.0.jar");
- noDescriptorsJars.add("commons-pool.jar");
- noDescriptorsJars.add("commons-digester.jar");
- noDescriptorsJars.add("commons-logging.jar");
- noDescriptorsJars.add("commons-collections.jar");
- noDescriptorsJars.add("jmx.jar");
- noDescriptorsJars.add("jmx-tools.jar");
- noDescriptorsJars.add("xercesImpl.jar");
- noDescriptorsJars.add("xmlParserAPIs.jar");
- noDescriptorsJars.add("xml-apis.jar");
- // JARs from J2SE runtime
- noDescriptorsJars.add("sunjce_provider.jar");
- noDescriptorsJars.add("ldapsec.jar");
- noDescriptorsJars.add("localedata.jar");
- noDescriptorsJars.add("dnsns.jar");
- noDescriptorsJars.add("tools.jar");
- noDescriptorsJars.add("sunpkcs11.jar");
- }
-
-
- // ----------------------------------------------------- Instance Variables
-
- /**
- * The Context we are associated with.
- */
- private Context context = null;
-
-
- /**
- * The string resources for this package.
- */
- private static final StringManager sm =
- StringManager.getManager(Constants.Package);
-
- /**
- * The <code>Digester</code> we will use to process tag library
- * descriptor files.
- */
- private static Digester tldDigester = null;
-
-
- /**
- * Attribute value used to turn on/off TLD validation
- */
- private static boolean tldValidation = false;
-
-
- /**
- * Attribute value used to turn on/off TLD namespace awarenes.
- */
- private static boolean tldNamespaceAware = false;
-
- private boolean rescan=true;
-
- private ArrayList<String> listeners = new ArrayList<String>();
-
- // --------------------------------------------------------- Public Methods
-
- /**
- * Sets the list of JARs that are known not to contain any TLDs.
- *
- * @param jarNames List of comma-separated names of JAR files that are
- * known not to contain any TLDs
- */
- public static void setNoTldJars(String jarNames) {
- if (jarNames != null) {
- noDescriptorsJars.clear();
- StringTokenizer tokenizer = new StringTokenizer(jarNames, ",");
- while (tokenizer.hasMoreElements()) {
- noDescriptorsJars.add(tokenizer.nextToken());
- }
- }
- }
-
- /**
- * Set the validation feature of the XML parser used when
- * parsing xml instances.
- * @param tldValidation true to enable xml instance validation
- */
- public void setTldValidation(boolean tldValidation){
- WarScanner.tldValidation = tldValidation;
- }
-
- /**
- * Get the server.xml <host> attribute's xmlValidation.
- * @return true if validation is enabled.
- *
- */
- public boolean getTldValidation(){
- return tldValidation;
- }
-
- /**
- * Get the server.xml <host> attribute's xmlNamespaceAware.
- * @return true if namespace awarenes is enabled.
- *
- */
- public boolean getTldNamespaceAware(){
- return tldNamespaceAware;
- }
-
-
- /**
- * Set the namespace aware feature of the XML parser used when
- * parsing xml instances.
- * @param tldNamespaceAware true to enable namespace awareness
- */
- public void setTldNamespaceAware(boolean tldNamespaceAware){
- WarScanner.tldNamespaceAware = tldNamespaceAware;
- }
-
-
- public boolean isRescan() {
- return rescan;
- }
-
- public void setRescan(boolean rescan) {
- this.rescan = rescan;
- }
-
- public Context getContext() {
- return context;
- }
-
- public void setContext(Context context) {
- this.context = context;
- }
-
- public void addApplicationListener( String s ) {
- //if(log.isDebugEnabled())
- log.debug( "Add tld listener " + s);
- listeners.add(s);
- }
-
- public String[] getTldListeners() {
- String result[]=new String[listeners.size()];
- listeners.toArray(result);
- return result;
- }
-
-
- /**
- * Scan for and configure all tag library descriptors found in this
- * web application.
- *
- * @exception Exception if a fatal input/output or parsing error occurs
- */
- public void execute() throws Exception {
- long t1=System.currentTimeMillis();
-
- /*
- * Acquire the list of TLD resource paths, possibly embedded in JAR
- * files, to be processed
- */
- Set resourcePaths = tldScanResourcePaths();
- Map<String, File> jarPaths = getJarPaths();
-
- // Scan each accumulated resource path for TLDs to be processed
- Iterator paths = resourcePaths.iterator();
- while (paths.hasNext()) {
- String path = (String) paths.next();
- if (path.endsWith(".jar")) {
- tldScanJar(path);
- } else {
- tldScanTld(path);
- }
- }
- if (jarPaths != null) {
- paths = jarPaths.values().iterator();
- while (paths.hasNext()) {
- tldScanJar((File) paths.next());
- }
- }
-
- String list[] = getTldListeners();
-
- if( log.isDebugEnabled() )
- log.debug( "Adding tld listeners:" + list.length);
- for( int i=0; list!=null && i<list.length; i++ ) {
- context.addApplicationListener(list[i]);
- }
-
- long t2=System.currentTimeMillis();
- if( context instanceof StandardContext ) {
- ((StandardContext)context).setTldScanTime(t2-t1);
- }
-
- }
-
- // -------------------------------------------------------- Private Methods
-
- /*
- * Returns the last modification date of the given sets of resources.
- *
- * @param resourcePaths
- * @param jarPaths
- *
- * @return Last modification date
- */
- private long getLastModified(Set resourcePaths, Map jarPaths)
- throws Exception {
-
- long lastModified = 0;
-
- Iterator paths = resourcePaths.iterator();
- while (paths.hasNext()) {
- String path = (String) paths.next();
- URL url = context.getServletContext().getResource(path);
- if (url == null) {
- log.debug( "Null url "+ path );
- break;
- }
- long lastM = url.openConnection().getLastModified();
- if (lastM > lastModified) lastModified = lastM;
- if (log.isDebugEnabled()) {
- log.debug( "Last modified " + path + " " + lastM);
- }
- }
-
- if (jarPaths != null) {
- paths = jarPaths.values().iterator();
- while (paths.hasNext()) {
- File jarFile = (File) paths.next();
- long lastM = jarFile.lastModified();
- if (lastM > lastModified) lastModified = lastM;
- if (log.isDebugEnabled()) {
- log.debug("Last modified " + jarFile.getAbsolutePath()
- + " " + lastM);
- }
- }
- }
-
- return lastModified;
- }
-
- private void processCache(File tldCache ) throws IOException {
- // read the cache and return;
- try {
- FileInputStream in=new FileInputStream(tldCache);
- ObjectInputStream ois=new ObjectInputStream( in );
- String list[]=(String [])ois.readObject();
- if( log.isDebugEnabled() )
- log.debug("Reusing tldCache " + tldCache + " " +
list.length);
- for( int i=0; list!=null && i<list.length; i++ ) {
- context.addApplicationListener(list[i]);
- }
- ois.close();
- } catch( ClassNotFoundException ex ) {
- ex.printStackTrace();
- }
- }
-
- /**
- * Create (if necessary) and return a Digester configured to process a tag
- * library descriptor, looking for additional listener classes to be
- * registered.
- */
- private static Digester createTldDigester() {
-
- return DigesterFactory.newDigester(tldValidation,
- tldNamespaceAware,
- new TldRuleSet());
-
- }
-
-
- /**
- * Scan the JAR file at the specified resource path for TLDs in the
- * <code>META-INF</code> subdirectory, and scan each TLD for application
- * event listeners that need to be registered.
- *
- * @param resourcePath Resource path of the JAR file to scan
- *
- * @exception Exception if an exception occurs while scanning this JAR
- */
- private void tldScanJar(String resourcePath) throws Exception {
-
- if (log.isDebugEnabled()) {
- log.debug(" Scanning JAR at resource path '" + resourcePath +
"'");
- }
-
- URL url = context.getServletContext().getResource(resourcePath);
- if (url == null) {
- throw new IllegalArgumentException
- (sm.getString("contextConfig.tldResourcePath",
- resourcePath));
- }
-
- File file = null;
- try {
- file = new File(url.toURI());
- } catch (URISyntaxException e) {
- // Ignore, probably an unencoded char
- file = new File(url.getFile());
- }
- try {
- file = file.getCanonicalFile();
- } catch (IOException e) {
- // Ignore
- }
- tldScanJar(file);
-
- }
-
- /**
- * Scans all TLD entries in the given JAR for application listeners.
- *
- * @param file JAR file whose TLD entries are scanned for application
- * listeners
- */
- private void tldScanJar(File file) throws Exception {
-
- JarFile jarFile = null;
- String name = null;
-
- String jarPath = file.getAbsolutePath();
-
- try {
- jarFile = new JarFile(file);
- Enumeration entries = jarFile.entries();
- while (entries.hasMoreElements()) {
- JarEntry entry = (JarEntry) entries.nextElement();
- name = entry.getName();
- if (!name.startsWith("META-INF/")) {
- continue;
- }
- if (!name.endsWith(".tld")) {
- continue;
- }
- if (log.isTraceEnabled()) {
- log.trace(" Processing TLD at '" + name +
"'");
- }
- try {
- tldScanStream(new InputSource(jarFile.getInputStream(entry)));
- } catch (Exception e) {
- log.error(sm.getString("contextConfig.tldEntryException",
- name, jarPath, context.getPath()),
- e);
- }
- }
- } catch (Exception e) {
- log.error(sm.getString("contextConfig.tldJarException",
- jarPath, context.getPath()),
- e);
- } finally {
- if (jarFile != null) {
- try {
- jarFile.close();
- } catch (Throwable t) {
- // Ignore
- }
- }
- }
- }
-
- /**
- * Scan the TLD contents in the specified input stream, and register
- * any application event listeners found there. <b>NOTE</b> - It is
- * the responsibility of the caller to close the InputStream after this
- * method returns.
- *
- * @param resourceStream InputStream containing a tag library descriptor
- *
- * @exception Exception if an exception occurs while scanning this TLD
- */
- private void tldScanStream(InputSource resourceStream)
- throws Exception {
-
- if (tldDigester == null){
- tldDigester = createTldDigester();
- }
-
- synchronized (tldDigester) {
- try {
- tldDigester.push(this);
- tldDigester.parse(resourceStream);
- } finally {
- tldDigester.reset();
- }
- }
-
- }
-
- /**
- * Scan the TLD contents at the specified resource path, and register
- * any application event listeners found there.
- *
- * @param resourcePath Resource path being scanned
- *
- * @exception Exception if an exception occurs while scanning this TLD
- */
- private void tldScanTld(String resourcePath) throws Exception {
-
- if (log.isDebugEnabled()) {
- log.debug(" Scanning TLD at resource path '" + resourcePath +
"'");
- }
-
- InputSource inputSource = null;
- try {
- InputStream stream =
- context.getServletContext().getResourceAsStream(resourcePath);
- if (stream == null) {
- throw new IllegalArgumentException
- (sm.getString("contextConfig.tldResourcePath",
- resourcePath));
- }
- inputSource = new InputSource(stream);
- if (inputSource == null) {
- throw new IllegalArgumentException
- (sm.getString("contextConfig.tldResourcePath",
- resourcePath));
- }
- tldScanStream(inputSource);
- } catch (Exception e) {
- throw new ServletException
- (sm.getString("contextConfig.tldFileException", resourcePath,
- context.getPath()),
- e);
- }
-
- }
-
- /**
- * Accumulate and return a Set of resource paths to be analyzed for
- * tag library descriptors. Each element of the returned set will be
- * the context-relative path to either a tag library descriptor file,
- * or to a JAR file that may contain tag library descriptors in its
- * <code>META-INF</code> subdirectory.
- *
- * @exception IOException if an input/output error occurs while
- * accumulating the list of resource paths
- */
- private Set<String> tldScanResourcePaths() throws IOException {
- if (log.isDebugEnabled()) {
- log.debug(" Accumulating TLD resource paths");
- }
- Set<String> resourcePaths = new HashSet<String>();
-
- // Accumulate resource paths explicitly listed in the web application
- // deployment descriptor
- if (log.isTraceEnabled()) {
- log.trace(" Scanning <taglib> elements in web.xml");
- }
- String taglibs[] = context.findTaglibs();
- for (int i = 0; i < taglibs.length; i++) {
- String resourcePath = context.findTaglib(taglibs[i]);
- // FIXME - Servlet 2.4 DTD implies that the location MUST be
- // a context-relative path starting with '/'?
- if (!resourcePath.startsWith("/")) {
- resourcePath = "/WEB-INF/" + resourcePath;
- }
- if (log.isTraceEnabled()) {
- log.trace(" Adding path '" + resourcePath +
- "' for URI '" + taglibs[i] + "'");
- }
- resourcePaths.add(resourcePath);
- }
-
- DirContext resources = context.getResources();
- if (resources != null) {
- tldScanResourcePathsWebInf(resources, "/WEB-INF", resourcePaths);
- }
-
- // Return the completed set
- return (resourcePaths);
-
- }
-
- /*
- * Scans the web application's subdirectory identified by rootPath,
- * along with its subdirectories, for TLDs.
- *
- * Initially, rootPath equals /WEB-INF. The /WEB-INF/classes and
- * /WEB-INF/lib subdirectories are excluded from the search, as per the
- * JSP 2.0 spec.
- *
- * @param resources The web application's resources
- * @param rootPath The path whose subdirectories are to be searched for
- * TLDs
- * @param tldPaths The set of TLD resource paths to add to
- */
- private void tldScanResourcePathsWebInf(DirContext resources,
- String rootPath,
- Set tldPaths)
- throws IOException {
-
- if (log.isTraceEnabled()) {
- log.trace(" Scanning TLDs in " + rootPath + "
subdirectory");
- }
-
- try {
- NamingEnumeration items = resources.list(rootPath);
- while (items.hasMoreElements()) {
- NameClassPair item = (NameClassPair) items.nextElement();
- String resourcePath = rootPath + "/" + item.getName();
- if (!resourcePath.endsWith(".tld")
- &&
(resourcePath.startsWith("/WEB-INF/classes")
- || resourcePath.startsWith("/WEB-INF/lib"))) {
- continue;
- }
- if (resourcePath.endsWith(".tld")) {
- if (log.isTraceEnabled()) {
- log.trace(" Adding path '" + resourcePath +
"'");
- }
- tldPaths.add(resourcePath);
- } else {
- tldScanResourcePathsWebInf(resources, resourcePath,
- tldPaths);
- }
- }
- } catch (NamingException e) {
- ; // Silent catch: it's valid that no /WEB-INF directory exists
- }
- }
-
- /**
- * Returns a map of the paths to all JAR files that are accessible to the
- * webapp and will be scanned for TLDs.
- *
- * The map always includes all the JARs under WEB-INF/lib, as well as
- * shared JARs in the classloader delegation chain of the webapp's
- * classloader.
- *
- * The latter constitutes a Tomcat-specific extension to the TLD search
- * order defined in the JSP spec. It allows tag libraries packaged as JAR
- * files to be shared by web applications by simply dropping them in a
- * location that all web applications have access to (e.g.,
- * <CATALINA_HOME>/common/lib).
- *
- * The set of shared JARs to be scanned for TLDs is narrowed down by
- * the <tt>noTldJars</tt> class variable, which contains the names of
JARs
- * that are known not to contain any TLDs.
- *
- * @return Map of JAR file paths
- */
- private Map<String, File> getJarPaths() {
-
- HashMap<String, File> jarPathMap = null;
-
- ClassLoader webappLoader = Thread.currentThread().getContextClassLoader();
- ClassLoader loader = webappLoader;
- while (loader != null) {
- if (loader instanceof URLClassLoader) {
- URL[] urls = ((URLClassLoader) loader).getURLs();
- for (int i=0; i<urls.length; i++) {
- // Expect file URLs, these are %xx encoded or not depending on
- // the class loader
- // This is definitely not as clean as using JAR URLs either
- // over file or the custom jndi handler, but a lot less
- // buggy overall
- File file = null;
- try {
- file = new File(urls[i].toURI());
- } catch (Exception e) {
- // Ignore, probably an unencoded char or non file URL,
- // attempt direct access
- file = new File(urls[i].getFile());
- }
- try {
- file = file.getCanonicalFile();
- } catch (IOException e) {
- // Ignore
- }
- if (!file.exists()) {
- continue;
- }
- String path = file.getAbsolutePath();
- if (!path.endsWith(".jar")) {
- continue;
- }
- /*
- * Scan all JARs from WEB-INF/lib, plus any shared JARs
- * that are not known not to contain any TLDs
- */
- if (loader == webappLoader
- || noDescriptorsJars == null
- || !noDescriptorsJars.contains(file.getName())) {
- if (jarPathMap == null) {
- jarPathMap = new HashMap();
- jarPathMap.put(path, file);
- } else if (!jarPathMap.containsKey(path)) {
- jarPathMap.put(path, file);
- }
- }
- }
- }
- loader = loader.getParent();
- }
-
- return jarPathMap;
- }
-}
Deleted: trunk/java/org/apache/tomcat/WarComponents.java
===================================================================
--- trunk/java/org/apache/tomcat/WarComponents.java 2009-06-06 22:23:25 UTC (rev 1089)
+++ trunk/java/org/apache/tomcat/WarComponents.java 2009-06-06 22:34:44 UTC (rev 1090)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-
-package org.apache.tomcat;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-public interface WarComponents {
-
- public interface ServletContainerInitializerInfo {
- public Set<Class<?>> getStartupNotifySet();
- public Class<?>[] getInterestClasses();
- public Class<?> getServletContainerInitializer();
- }
-
- /**
- * Find JAR files containing an overlay.
- */
- public Iterator<String> getOverlays();
-
- /**
- * Find JAR files containing a web fragment.
- */
- public Iterator<String> getWebFragments();
-
- /**
- * Find TLDs.
- */
- public Map<String, Set<String>> getTLDs();
-
- /**
- * Find Jar services.
- */
- public Map<String, ServletContainerInitializerInfo>
getServletContainerInitializerInfo();
-
-}
Modified: trunk/res/confinstall/server_2.xml
===================================================================
--- trunk/res/confinstall/server_2.xml 2009-06-06 22:23:25 UTC (rev 1089)
+++ trunk/res/confinstall/server_2.xml 2009-06-06 22:34:44 UTC (rev 1090)
@@ -35,8 +35,7 @@
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
- unpackWARs="true" autoDeploy="true"
- xmlValidation="false" xmlNamespaceAware="false">
+ unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->