diff -r 1ba82aa68f39 web.jspparser/extsrc/org/netbeans/modules/web/jspparser_ext/WebAppParseSupport.java --- a/web.jspparser/extsrc/org/netbeans/modules/web/jspparser_ext/WebAppParseSupport.java Wed Oct 21 13:48:16 2009 +0200 +++ b/web.jspparser/extsrc/org/netbeans/modules/web/jspparser_ext/WebAppParseSupport.java Wed Oct 21 15:07:37 2009 +0200 @@ -710,41 +710,45 @@ tmpMappings.clear(); } - Thread compThread = new WebAppParseSupport.InitTldLocationCacheThread(lc); - compThread.setContextClassLoader(waContextClassLoader); - long start = 0; - if (LOG.isLoggable(Level.FINE)) { - start = System.currentTimeMillis(); - LOG.fine("InitTldLocationCacheThread start"); + try { + Thread compThread = new WebAppParseSupport.InitTldLocationCacheThread(lc); + compThread.setContextClassLoader(waContextClassLoader); + long start = 0; + if (LOG.isLoggable(Level.FINE)) { + start = System.currentTimeMillis(); + LOG.fine("InitTldLocationCacheThread start"); + } + compThread.start(); + + try { + compThread.join(); + if (LOG.isLoggable(Level.FINE)) { + long end = System.currentTimeMillis(); + LOG.fine("InitTldLocationCacheThread finished in " + (end - start) + " ms"); + } + } catch (InterruptedException e) { + LOG.log(Level.INFO, null, e); + } + + // obtain the current mappings after parsing + tmpMappings = (Map) mappingsField.get(lc); + + // disk options + lc = diskOptions.getTldLocationsCache(); + + mappingsField = TldLocationsCache.class.getDeclaredField("mappings"); //NOI18N + mappingsField.setAccessible(true); + // store the same tld cache into disk options as well + mappingsField.set(lc, tmpMappings); + + // update cache + mappings.clear(); + mappings.putAll(tmpMappings); + // cache tld files under WEB-INF directory as well + mappings.putAll(getImplicitLocation()); + } finally { + resetClassLoaders(); } - compThread.start(); - - try { - compThread.join(); - if (LOG.isLoggable(Level.FINE)) { - long end = System.currentTimeMillis(); - LOG.fine("InitTldLocationCacheThread finished in " + (end - start) + " ms"); - } - } catch (InterruptedException e) { - LOG.log(Level.INFO, null, e); - } - - // obtain the current mappings after parsing - tmpMappings = (Map) mappingsField.get(lc); - - // disk options - lc = diskOptions.getTldLocationsCache(); - - mappingsField = TldLocationsCache.class.getDeclaredField("mappings"); //NOI18N - mappingsField.setAccessible(true); - // store the same tld cache into disk options as well - mappingsField.set(lc, tmpMappings); - - // update cache - mappings.clear(); - mappings.putAll(tmpMappings); - // cache tld files under WEB-INF directory as well - mappings.putAll(getImplicitLocation()); } catch (NoSuchFieldException e) { LOG.log(Level.INFO, null, e); } catch (IllegalAccessException e) {