]
Marek Novotny closed JBSEAM-4732.
---------------------------------
Resolution: Out of Date
Facelets Classloading Takes Much Longer when jsf-facelets.jar is
Deployed in a Common Location
----------------------------------------------------------------------------------------------
Key: JBSEAM-4732
URL:
https://issues.jboss.org/browse/JBSEAM-4732
Project: Seam 2
Issue Type: Bug
Reporter: Gary Hu
Assignee: Marek Novotny
Attachments: facelets-1.1.15.B1.patch
The facelets 1.1.15.B1 is placed under the $JBOSS_HOME/server/$PROFILE/lib folder.
In EAP 4.3, it takes about 2s to load the facelets library, but in EAP 5.0 it takes about
15s.
The following facelets code is analyzed, which tells us the slowness comes from the
facelets library loading:
public static URL[] search(ClassLoader cl, String prefix, String suffix) throws
IOException {
Enumeration[] e = new Enumeration[] {
cl.getResources(prefix),
cl.getResources(prefix + "MANIFEST.MF")
};
Set all = new LinkedHashSet();
URL url;
URLConnection conn;
JarFile jarFile;
for (int i = 0, s = e.length; i < s; ++i) {
while (e[i].hasMoreElements()) {
url = (URL) e[i].nextElement();
conn = url.openConnection();
conn.setUseCaches(false);
conn.setDefaultUseCaches(false);
if (conn instanceof JarURLConnection) {
jarFile = ((JarURLConnection) conn).getJarFile();
} else {
jarFile = getAlternativeJarFile(url);
}
if (jarFile != null) {
searchJar(cl, all, jarFile, prefix, suffix);
} else {
boolean searchDone = searchDir(all, new File(URLDecoder.decode(url.getFile(),
"UTF-8")), suffix);
if (!searchDone)
{
searchFromURL(all, prefix, suffix, url);
}
}
}
}
URL[] urlArray = (URL[]) all.toArray(new URL[all.size()]);
return urlArray;
}
This method is called from com.sun.facelets.compiler.TagLibraryConfig.loadImplicit() with
the followign statement:
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL[] urls = Classpath.search(cl, "META-INF/", SUFFIX); //SUFFIX is
".taglib.xml"
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: