[jboss-cvs] JBossAS SVN: r93278 - in trunk: tomcat and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 8 11:12:26 EDT 2009


Author: remy.maucherat at jboss.com
Date: 2009-09-08 11:12:24 -0400 (Tue, 08 Sep 2009)
New Revision: 93278

Removed:
   trunk/tomcat/readme
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextJarRepository.java
Modified:
   trunk/component-matrix/pom.xml
   trunk/tomcat/build.xml
   trunk/tomcat/pom.xml
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/DeployerConfig.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextConfig.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployer.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java
   trunk/tomcat/src/resources/war-deployers-jboss-beans.xml
Log:
- Update to new metadata web build.
- Add the new deployers for TLDs and fragments.
- Add a new "manual" mechanism for shared TLDs (that will need to be improved).
- Allow shared web.xml to be in jbossweb.sar.
- Switch to parsing TLDs using JBoss Metadata.

Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml	2009-09-08 14:04:37 UTC (rev 93277)
+++ trunk/component-matrix/pom.xml	2009-09-08 15:12:24 UTC (rev 93278)
@@ -92,7 +92,7 @@
     <version.org.jboss.metadata.ear>2.0.0.Alpha</version.org.jboss.metadata.ear>
     <version.org.jboss.metadata.ejb>2.0.0.Alpha</version.org.jboss.metadata.ejb>
     <version.org.jboss.metadata.rar>2.0.0.Alpha</version.org.jboss.metadata.rar>
-    <version.org.jboss.metadata.war>2.0.0.Alpha</version.org.jboss.metadata.war>
+    <version.org.jboss.metadata.war>2.0.0.Alpha2</version.org.jboss.metadata.war>
     <version.org.jboss.microcontainer>2.0.8.GA</version.org.jboss.microcontainer>
     <version.org.jboss.mx>6.0.0.Beta1</version.org.jboss.mx>
     <version.org.jboss.naming>5.0.3.GA</version.org.jboss.naming>

Modified: trunk/tomcat/build.xml
===================================================================
--- trunk/tomcat/build.xml	2009-09-08 14:04:37 UTC (rev 93277)
+++ trunk/tomcat/build.xml	2009-09-08 15:12:24 UTC (rev 93278)
@@ -236,8 +236,6 @@
     <mkdir dir="${build.deploy}/jboss-web.deployer/META-INF"/>
 
     <!-- Build the jboss-web.deployer -->
-    <copy file="${build.resources}/web.xml"
-        tofile="${build.deploy}/jboss-web.deployer/web.xml"/>
     <copy todir="${build.deploy}/jboss-web.deployer/META-INF">
        <fileset dir="${build.resources}">
           <include name="jboss-structure.xml" />
@@ -272,6 +270,8 @@
       todir="${build.deploy}/jbossweb.sar"/>
     <copy file="${build.resources}/server.xml"
       tofile="${build.deploy}/jbossweb.sar/server.xml"/>
+    <copy file="${build.resources}/web.xml"
+      tofile="${build.deploy}/jbossweb.sar/web.xml"/>
     <copy todir="${build.deploy}/jbossweb.sar">
       <fileset dir="${jboss.web.lib}">
         <include name="*.jar"/>

Modified: trunk/tomcat/pom.xml
===================================================================
--- trunk/tomcat/pom.xml	2009-09-08 14:04:37 UTC (rev 93277)
+++ trunk/tomcat/pom.xml	2009-09-08 15:12:24 UTC (rev 93278)
@@ -86,9 +86,6 @@
                       tofile="${output.lib}/jbossweb-cluster.aop"/>-->
                 
                 <mkdir dir="${output.deploy}/jboss-web.deployer/META-INF"/>
-                
-                <copy file="${output.resources}/web.xml"
-                    tofile="${output.deploy}/jboss-web.deployer/web.xml"/>
                 <copy todir="${output.deploy}/jboss-web.deployer/META-INF">
                    <fileset dir="${output.resources}">
                       <include name="jboss-structure.xml" />
@@ -110,6 +107,8 @@
                     
                 <copy file="${output.resources}/context.xml"
                   todir="${output.deploy}/jbossweb.sar"/>
+                <copy file="${output.resources}/web.xml"
+                  tofile="${output.deploy}/jbossweb.sar/web.xml"/>
                 <copy file="${output.resources}/server.xml"
                   tofile="${output.deploy}/jbossweb.sar/server.xml"/>
                 <copy file="${maven.dependency.jboss.web.jasper-jdt.jar.path}"

Deleted: trunk/tomcat/readme
===================================================================
--- trunk/tomcat/readme	2009-09-08 14:04:37 UTC (rev 93277)
+++ trunk/tomcat/readme	2009-09-08 15:12:24 UTC (rev 93278)
@@ -1,2 +0,0 @@
-The JBoss/Tomcat bundle is now the default. Building the standard
-dist created the JBoss/Tomcat bundle.

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/DeployerConfig.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/DeployerConfig.java	2009-09-08 14:04:37 UTC (rev 93277)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/DeployerConfig.java	2009-09-08 15:12:24 UTC (rev 93278)
@@ -21,9 +21,12 @@
  */
 package org.jboss.web.tomcat.service.deployers;
 
+import java.util.List;
+
 import javax.management.ObjectName;
 
 import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.TldMetaData;
 import org.jboss.security.plugins.JaasSecurityManagerServiceMBean;
 
 /**
@@ -110,6 +113,11 @@
    private JBossWebMetaData sharedMetaData = null;
 
    /**
+    * Shared TLD metaData.
+    */
+   private List<TldMetaData> sharedTldMetaData = null;
+
+   /**
     * Flag indicating whether web-app specific context xmls may set the privileged flag.
     */
    private boolean allowSelfPrivilegedWebApps = false;
@@ -314,6 +322,16 @@
       this.sharedMetaData = sharedMetaData;
    }
 
+   public List<TldMetaData> getSharedTldMetaData()
+   {
+      return sharedTldMetaData;
+   }
+
+   public void setSharedTldMetaData(List<TldMetaData> sharedTldMetaData)
+   {
+      this.sharedTldMetaData = sharedTldMetaData;
+   }
+
    /**
     * Gets whether the session <code>Manager</code> implementation for 
     * distributable webapps should be overridden with an instance of 

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextConfig.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextConfig.java	2009-09-08 14:04:37 UTC (rev 93277)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextConfig.java	2009-09-08 15:12:24 UTC (rev 93278)
@@ -32,17 +32,14 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
-import java.util.jar.JarFile;
 
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.servlet.ServletContext;
 import javax.xml.namespace.QName;
 
-import org.apache.catalina.JarRepository;
 import org.apache.catalina.core.ContextJarRepository;
 import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.deploy.JspPropertyGroup;
 import org.apache.catalina.deploy.SessionCookie;
 import org.apache.catalina.deploy.jsp.FunctionInfo;
 import org.apache.catalina.deploy.jsp.TagAttributeInfo;
@@ -51,11 +48,7 @@
 import org.apache.catalina.deploy.jsp.TagLibraryValidatorInfo;
 import org.apache.catalina.deploy.jsp.TagVariableInfo;
 import org.apache.catalina.startup.ContextConfig;
-import org.apache.catalina.startup.WebAnnotationSet;
 import org.apache.tomcat.util.IntrospectionUtils;
-import org.apache.naming.resources.JARDirContext;
-import org.apache.naming.resources.ProxyDirContext;
-
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.kernel.Kernel;
@@ -444,13 +437,13 @@
                }
                jspPropertyGroup.setElIgnored(group.getElIgnored());
                jspPropertyGroup.setPageEncoding(group.getPageEncoding());
-               jspPropertyGroup.setScriptingInvalid(group.isScriptingInvalid());
-               jspPropertyGroup.setIsXml(group.getXml());
-               for (String includePrelude : group.getIncludePrelude())
+               jspPropertyGroup.setScriptingInvalid(group.getScriptingInvalid());
+               jspPropertyGroup.setIsXml(group.getIsXml());
+               for (String includePrelude : group.getIncludePreludes())
                {
                   jspPropertyGroup.addIncludePrelude(includePrelude);
                }
-               for (String includeCoda : group.getIncludeCoda())
+               for (String includeCoda : group.getIncludeCodas())
                {
                   jspPropertyGroup.addIncludeCoda(includeCoda);
                }
@@ -608,11 +601,6 @@
     */
    protected void init()
    {
-      // FIXME: remove when AS takes over TLD parsing
-      if (tldDigester == null) {
-         tldDigester = createTldDigester();
-         tldDigester.getParser();
-      }
 
       context.setConfigured(false);
       ok = true;
@@ -625,10 +613,9 @@
       // This should come from the deployment unit
       processContextConfig(context.getConfigFile(), true);
 
-      // FIXME: some operations will be delegated to JBoss Web until AS implements them
-      // Includes: fragment processing, overlay, TLD processing
-      if (context.getJarRepository() == null) {
-         context.setJarRepository(new JBossContextJarRepository("jsf-libs/jsf-impl.jar,jstl.jar"));
+      if (context.getJarRepository() == null)
+      {
+         context.setJarRepository(new ContextJarRepository());
       }
 
    }
@@ -792,11 +779,6 @@
    protected void applicationTldConfig()
    {
       
-      // BEGIN TEMP CODE
-      super.applicationTldConfig();
-      tldMetaDataMapLocal.set(null);
-      // END TEMP CODE
-      
       Map<String, TldMetaData> tldMetaDataMap = tldMetaDataMapLocal.get();
       if (tldMetaDataMap == null)
       {
@@ -815,38 +797,45 @@
       Iterator<String> locationInterator = tldMetaDataMap.keySet().iterator();
       while (locationInterator.hasNext())
       {
+         String relativeLocation = null;
+         String jarPath = null;
+         
          String location = locationInterator.next();
+         if (location.equals(TldMetaData.class.getName()))
+         {
+            // If there is only one TLD, it will also get mapped as this attachement
+            continue;
+         }
          TldMetaData tldMetaData = tldMetaDataMap.get(location);
          pos = location.indexOf(':');
          if (pos > 0)
          {
             location = location.substring(pos);
          }
-         if (!location.startsWith(base))
+         if (location.startsWith(base))
          {
-            // If there is only one TLD, it will also get mapped as this attachement
-            continue;
-         }
-         String relativeLocation = "/" + location.substring(base.length());
-         String jarPath = null;
-         if (relativeLocation.startsWith("/WEB-INF/lib/"))
-         {
-            pos = relativeLocation.indexOf('/', "/WEB-INF/lib/".length());
-            if (pos > 0)
+            relativeLocation = "/" + location.substring(base.length());
+            if (relativeLocation.startsWith("/WEB-INF/lib/"))
             {
-               jarPath = relativeLocation.substring(pos);
-               if (jarPath.startsWith("/"))
+               pos = relativeLocation.indexOf('/', "/WEB-INF/lib/".length());
+               if (pos > 0)
                {
-                  jarPath = jarPath.substring(1);
+                  jarPath = relativeLocation.substring(pos);
+                  if (jarPath.startsWith("/"))
+                  {
+                     jarPath = jarPath.substring(1);
+                  }
+                  relativeLocation = relativeLocation.substring(0, pos);
                }
-               relativeLocation = relativeLocation.substring(0, pos);
             }
          }
-         System.out.println("Add TLD: " + relativeLocation + " " + jarPath +  " [" + tldMetaData + "]");
 
          TagLibraryInfo tagLibraryInfo = new TagLibraryInfo();
          tagLibraryInfo.setTlibversion(tldMetaData.getTlibVersion());
-         tagLibraryInfo.setJspversion(tldMetaData.getJspVersion());
+         if (tldMetaData.getJspVersion() == null)
+            tagLibraryInfo.setJspversion(tldMetaData.getVersion());
+         else
+            tagLibraryInfo.setJspversion(tldMetaData.getJspVersion());
          tagLibraryInfo.setShortname(tldMetaData.getShortName());
          tagLibraryInfo.setUri(tldMetaData.getUri());
          // Listener
@@ -908,15 +897,10 @@
                      tagAttributeInfo.setReqTime("" + attributeMetaData.getRtexprvalue());
                      tagAttributeInfo.setRequired("" + attributeMetaData.getRequired());
                      tagAttributeInfo.setFragment("" + attributeMetaData.getFragment());
-                     // FIXME: the commented out block is the right one ...
-                     /*if (attributeMetaData.getDeferredValue() != null)
+                     if (attributeMetaData.getDeferredValue() != null)
                         tagAttributeInfo.setDeferredValue(attributeMetaData.getDeferredValue().getType());
                      if (attributeMetaData.getDeferredMethod() != null)
-                        tagAttributeInfo.setDeferredMethod(attributeMetaData.getDeferredMethod().getMethodSignature());*/
-                     if (attributeMetaData.getDeferredValue() != null)
-                        tagAttributeInfo.setDeferredValue(attributeMetaData.getDeferredValue().getMethodSignature());
-                     if (attributeMetaData.getDeferredMethod() != null)
-                        tagAttributeInfo.setDeferredMethod(attributeMetaData.getDeferredMethod().getType());
+                        tagAttributeInfo.setDeferredMethod(attributeMetaData.getDeferredMethod().getMethodSignature());
                      tagInfo.addTagAttributeInfo(tagAttributeInfo);
                   }
                }
@@ -936,8 +920,12 @@
             }
          }
          
-         if (jarPath == null)
+         if (jarPath == null && relativeLocation == null)
          {
+            context.addJspTagLibrary(tagLibraryInfo);
+         }
+         else if (jarPath == null)
+         {
             tagLibraryInfo.setLocation("");
             tagLibraryInfo.setPath(relativeLocation);
             tagLibraries.add(tagLibraryInfo);
@@ -955,7 +943,6 @@
                context.addJspTagLibrary(relativeLocation, tagLibraryInfo);
             }
          }
-
       }
 
       // Add additional TLDs URIs from explicit web config

Deleted: trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextJarRepository.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextJarRepository.java	2009-09-08 14:04:37 UTC (rev 93277)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextJarRepository.java	2009-09-08 15:12:24 UTC (rev 93278)
@@ -1,117 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jboss.web.tomcat.service.deployers;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.ArrayList;
-import java.util.StringTokenizer;
-import java.util.jar.JarFile;
-
-import org.apache.catalina.LifecycleException;
-import org.apache.catalina.core.ContextJarRepository;
-import org.jboss.logging.Logger;
-
-/**
- * Temporary class to add shared JARs to the webapp. This will allow supporting 
- * TLDs and other features by delegating them to Catalina.
- * 
- * @author remm
- * @deprecated To remove ...
- */
-public class JBossContextJarRepository extends ContextJarRepository
-{
-   private static Logger log = Logger.getLogger(JBossContextJarRepository.class);
-   ArrayList<String> tagLibJars = new ArrayList<String>();
-   
-   public JBossContextJarRepository(String tagLibJars)
-   {
-      super();
-      StringTokenizer tokenizer = new StringTokenizer(tagLibJars, ",");
-      while (tokenizer.hasMoreTokens())
-      {
-         this.tagLibJars.add(tokenizer.nextToken().trim());
-      }
-   }
-   
-   public synchronized void start() throws LifecycleException
-   {
-      super.start();
-      
-      ArrayList<JarFile> jarFilesArrayList = new ArrayList<JarFile>();
-      for (JarFile jarFile: jarFilesArray)
-      {
-         jarFilesArrayList.add(jarFile);
-      }
-      
-      try
-      {
-         ClassLoader loader = Thread.currentThread().getContextClassLoader();
-         URL web = loader.getResource("server.xml");
-         URL sarURL = new URL(web, ".");
-         for(int n = 0; n < tagLibJars.size(); n ++)
-         {
-            String jarPath = (String) tagLibJars.get(n);
-            URL url = new URL(sarURL, jarPath);
-            String resourcePath = url.toString();
-            log.debug("Scanning for tlds in: "+resourcePath);
-            URLConnection conn = url.openConnection();
-            conn.setUseCaches(false);
-            InputStream is = null;
-            OutputStream os = null;
-            try {
-               is = conn.getInputStream();
-               File tempJar = File.createTempFile(jarPath, ".tmp");
-               os = new FileOutputStream(tempJar);
-               byte[] buf = new byte[4096];
-               int numRead;
-               while ( (numRead = is.read(buf) ) >= 0) {
-                  os.write(buf, 0, numRead);
-               }
-               JarFile jarFile = new JarFile(tempJar);
-               jarFilesArrayList.add(jarFile);
-            }
-            catch (Exception e)
-            {
-               log.debug("Failed to process shared JAR: " + jarPath, e);
-            }
-            finally
-            {
-               if (is != null) is.close();
-               if (os != null) os.close();
-            }
-         }
-      }
-      catch (Exception e)
-      {
-         log.debug("Failed to process shared libs", e);
-      }
-      
-      jarFilesArray = jarFilesArrayList.toArray(new JarFile[0]);
-
-   }
-   
-}

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployer.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployer.java	2009-09-08 14:04:37 UTC (rev 93277)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployer.java	2009-09-08 15:12:24 UTC (rev 93278)
@@ -32,17 +32,22 @@
 import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.metadata.web.jboss.JBoss50WebMetaData;
 import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.Web25MetaData;
+import org.jboss.metadata.web.spec.TldMetaData;
 import org.jboss.metadata.web.spec.WebMetaData;
 import org.jboss.mx.util.ObjectNameFactory;
 import org.jboss.security.plugins.JaasSecurityManagerServiceMBean;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.VisitorAttributes;
+import org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter;
 import org.jboss.web.deployers.AbstractWarDeployer;
 import org.jboss.web.deployers.AbstractWarDeployment;
 import org.jboss.web.tomcat.service.session.SessionIDGenerator;
 import org.jboss.xb.binding.Unmarshaller;
 import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.builder.JBossXBBuilder;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
 
 /**
  * A concrete implementation of the AbstractWarDeployer that creates {@link #TomcatDeployment} instances as the web
@@ -117,6 +122,11 @@
    private JBossWebMetaData sharedMetaData = null;
 
    /**
+    * Shared TLD metaData.
+    */
+   private List<TldMetaData> sharedTldMetaData = null;
+
+   /**
     * The server xml configuration file name
     */
    private String serverConfigFile = "server.xml";
@@ -409,36 +419,6 @@
    }
 
    /**
-    * Start the deployer. This sets up the tomcat core.
-    */
-   @Override
-   public void start() throws Exception
-   {
-      super.start();
-
-      // Parse shared web.xml
-      Unmarshaller unmarshaller = factory.newUnmarshaller();
-      URL webXml = this.getClass().getClassLoader().getResource("web.xml");
-      if (webXml == null)
-      {
-         webXml = this.getClass().getClassLoader().getResource("conf/web.xml");;
-      }
-      if (webXml == null)
-         throw new IllegalStateException("Unable to find shared web.xml or conf/web.xml");
-      SchemaBinding schema = JBossXBBuilder.build(Web25MetaData.class);
-      Web25MetaData confWebMD = (Web25MetaData) unmarshaller.unmarshal(webXml.toString(), schema);
-      sharedMetaData = new JBoss50WebMetaData();
-      sharedMetaData.merge(null, confWebMD);
-
-   }
-
-   @Override
-   public void stop() throws Exception
-   {
-      super.stop();
-   }
-
-   /**
     * Create a tomcat war deployment bean for the deployment unit/metaData.
     * 
     * @param unit - the current web app deployment unit
@@ -454,6 +434,62 @@
       AbstractWarDeployment deployment = (AbstractWarDeployment) (getClass().getClassLoader().loadClass(className))
             .newInstance();
 
+      synchronized (this)
+      {
+         if (sharedMetaData == null)
+         {
+            Unmarshaller unmarshaller = factory.newUnmarshaller();
+            SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
+
+            // Parse shared web.xml
+            URL webXml = deployment.getClass().getClassLoader().getResource("web.xml");
+            System.out.println("Shared web.xml is: " + webXml);
+            if (webXml == null)
+            {
+               webXml = this.getClass().getClassLoader().getResource("web.xml");
+            }
+            if (webXml == null)
+            {
+               webXml = this.getClass().getClassLoader().getResource("conf/web.xml");
+            }
+            if (webXml == null)
+               throw new IllegalStateException("Unable to find shared web.xml or conf/web.xml");
+            WebMetaData confWebMD = (WebMetaData) unmarshaller.unmarshal(webXml.toString(), resolver);
+            sharedMetaData = new JBoss50WebMetaData();
+            sharedMetaData.merge(null, confWebMD);
+
+            // Parse shared JARs for TLDs
+            // TODO: Make the JAR list configurable
+            sharedTldMetaData = new ArrayList<TldMetaData>();
+            List<URL> urls = new ArrayList<URL>();
+            URL jstlURL = deployment.getClass().getClassLoader().getResource("jstl.jar");
+            if (jstlURL != null)
+            {
+               urls.add(jstlURL);
+            }
+            URL jsfURL = deployment.getClass().getClassLoader().getResource("jsf-libs/jsf-impl.jar");
+            if (jsfURL != null)
+            {
+               urls.add(jsfURL);
+            }
+            VirtualFileFilter tldFilter = new SuffixMatchFilter(".tld", VisitorAttributes.DEFAULT);
+            for (URL url : urls)
+            {
+               VFS vfs = VFS.getVFS(url);
+               VirtualFile metaInf = vfs.getChild("META-INF");
+               if (metaInf != null)
+               {
+                  List<VirtualFile> tlds = metaInf.getChildren(tldFilter);
+                  for (VirtualFile tld : tlds)
+                  {
+                     TldMetaData tldMetaData = (TldMetaData) unmarshaller.unmarshal(tld.toURL().toString(), resolver);
+                     sharedTldMetaData.add(tldMetaData);
+                  }
+               }
+            }
+         }
+      }
+      
       DeployerConfig config = new DeployerConfig();
       config.setDefaultSecurityDomain(this.defaultSecurityDomain);
       config.setSubjectAttributeName(this.subjectAttributeName);
@@ -474,6 +510,7 @@
       config.setSecurityManagerService(this.secMgrService);
       config.setFilteredPackages(filteredPackages);
       config.setSharedMetaData(sharedMetaData);
+      config.setSharedTldMetaData(sharedTldMetaData);
       config.setDeleteWorkDirs(deleteWorkDirOnContextDestroy);
 
       config.setSecurityContextClassName(securityContextClassName);

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java	2009-09-08 14:04:37 UTC (rev 93277)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java	2009-09-08 15:12:24 UTC (rev 93278)
@@ -21,15 +21,6 @@
  */
 package org.jboss.web.tomcat.service.deployers;
 
-import javax.management.Attribute;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.LinkRef;
-
-import java.io.File;
-import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLDecoder;
@@ -43,8 +34,14 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.zip.ZipFile;
 
+import javax.management.Attribute;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.LinkRef;
+
 import org.apache.catalina.LifecycleEvent;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Loader;
@@ -187,6 +184,10 @@
             tldMetaDataMap.put(name, (TldMetaData) attachement);
          }
       }
+      for (TldMetaData tldMetaData : config.getSharedTldMetaData())
+      {
+         tldMetaDataMap.put(tldMetaData.toString(), tldMetaData);
+      }
       
       TomcatInjectionContainer injectionContainer = new TomcatInjectionContainer(webApp, depUnit, context, getPersistenceUnitDependencyResolver());
 

Modified: trunk/tomcat/src/resources/war-deployers-jboss-beans.xml
===================================================================
--- trunk/tomcat/src/resources/war-deployers-jboss-beans.xml	2009-09-08 14:04:37 UTC (rev 93277)
+++ trunk/tomcat/src/resources/war-deployers-jboss-beans.xml	2009-09-08 15:12:24 UTC (rev 93278)
@@ -22,9 +22,15 @@
    <bean name="WebAppParsingDeployer" class="org.jboss.deployment.WebAppParsingDeployer">
       <property name="relativeOrder">2000</property>
    </bean>
-   <bean name="JBossWebAppParsingDeployer" class="org.jboss.deployment.JBossWebAppParsingDeployer">
+   <bean name="WebAppFragmentParsingDeployer" class="org.jboss.deployment.WebAppFragmentParsingDeployer">
       <property name="relativeOrder">2001</property>
    </bean>
+   <bean name="TldParsingDeployer" class="org.jboss.deployment.TldParsingDeployer">
+      <property name="relativeOrder">2002</property>
+   </bean>
+   <bean name="JBossWebAppParsingDeployer" class="org.jboss.deployment.JBossWebAppParsingDeployer">
+      <property name="relativeOrder">2003</property>
+   </bean>
 
   <!-- See JBAS-6062 -->
    <bean name="WebXmlLessDeployer" class="org.jboss.deployment.LegacyWebXmlLessDeployer"/>
@@ -137,7 +143,7 @@
       <!-- Inject the MainDeployer for resolving cross deployment refs -->
       <property name="mainDeployer"><inject bean="MainDeployer" /></property>
 
-      <property name="relativeOrder">2003</property>
+      <property name="relativeOrder">3000</property>
       
       <!-- FIXME Get this moved to TomcatService in deploy -->
       <property name="configFile">
@@ -244,4 +250,4 @@
           class="org.jboss.web.deployers.MergedJBossWebMetaDataDeployer">
    </bean>
 
-</deployment>
+</deployment>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list