ASF Bugzilla – Attachment 24919 Details for
Bug 48179
After startup seeing java.io.FileNotFoundException:<file path>/tldcache.ser (No such file or directory)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for TC 6
2010-02-03_tc6_bug48179.patch (text/plain), 5.27 KB, created by
Konstantin Kolinko
on 2010-02-03 01:44:18 UTC
(
hide
)
Description:
patch for TC 6
Filename:
MIME Type:
Creator:
Konstantin Kolinko
Created:
2010-02-03 01:44:18 UTC
Size:
5.27 KB
patch
obsolete
>Index: java/org/apache/catalina/startup/TldConfig.java >=================================================================== >--- java/org/apache/catalina/startup/TldConfig.java (revision 905877) >+++ java/org/apache/catalina/startup/TldConfig.java (working copy) >@@ -20,12 +20,8 @@ > > > import java.io.File; >-import java.io.FileInputStream; >-import java.io.FileOutputStream; > import java.io.IOException; > import java.io.InputStream; >-import java.io.ObjectInputStream; >-import java.io.ObjectOutputStream; > import java.net.URISyntaxException; > import java.net.URL; > import java.net.URLClassLoader; >@@ -47,7 +43,6 @@ > import javax.servlet.ServletException; > > import org.apache.catalina.Context; >-import org.apache.catalina.Globals; > import org.apache.catalina.Lifecycle; > import org.apache.catalina.LifecycleEvent; > import org.apache.catalina.LifecycleListener; >@@ -255,24 +250,6 @@ > public void execute() throws Exception { > long t1=System.currentTimeMillis(); > >- File tldCache=null; >- >- if (context instanceof StandardContext) { >- File workDir= (File) >- ((StandardContext)context).getServletContext().getAttribute(Globals.WORK_DIR_ATTR); >- //tldCache=new File( workDir, "tldCache.ser"); >- } >- >- // Option to not rescan >- if( ! rescan ) { >- // find the cache >- if( tldCache!= null && tldCache.exists()) { >- // just read it... >- processCache(tldCache); >- return; >- } >- } >- > /* > * Acquire the list of TLD resource paths, possibly embedded in JAR > * files, to be processed >@@ -280,15 +257,6 @@ > Set resourcePaths = tldScanResourcePaths(); > Map jarPaths = getJarPaths(); > >- // Check to see if we can use cached listeners >- if (tldCache != null && tldCache.exists()) { >- long lastModified = getLastModified(resourcePaths, jarPaths); >- if (lastModified < tldCache.lastModified()) { >- processCache(tldCache); >- return; >- } >- } >- > // Scan each accumulated resource path for TLDs to be processed > Iterator paths = resourcePaths.iterator(); > while (paths.hasNext()) { >@@ -308,18 +276,6 @@ > > String list[] = getTldListeners(); > >- if( tldCache!= null ) { >- log.debug( "Saving tld cache: " + tldCache + " " + list.length); >- try { >- FileOutputStream out=new FileOutputStream(tldCache); >- ObjectOutputStream oos=new ObjectOutputStream( out ); >- oos.writeObject( list ); >- oos.close(); >- } catch( IOException ex ) { >- ex.printStackTrace(); >- } >- } >- > if( log.isDebugEnabled() ) > log.debug( "Adding tld listeners:" + list.length); > for( int i=0; list!=null && i<list.length; i++ ) { >@@ -335,67 +291,6 @@ > > // -------------------------------------------------------- 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(); >- } >- } >- > /** > * Scan the JAR file at the specified resource path for TLDs in the > * <code>META-INF</code> subdirectory, and scan each TLD for application
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 48179
:
24918
| 24919