tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominik Drzewiecki" <drz...@post.pl>
Subject JDTCompiler and locked jar files *again*
Date Fri, 17 Dec 2004 10:47:35 GMT
I think I finally found it. And fixed it.
JDTCompiler uses JasperLoader.getResourceAsStream() which is *not* 
overriden in JasperLoader and uses getResourceAsStream() derived from 
java.net.URLClassLoader (in fact from java.lang.ClassLoader). 
j.l.ClassLoader's getResourceAsStream() implementation does not 
setUseCaches(false), therefore causes locking. I suggest overriding 
getResourceAsStream in JasperLoader by adding the following (or similar) 
method:

    public InputStream getResourceAsStream(String name) {
        
        URL url = getResource(name);
        
        if (url != null) {
            try {
                URLConnection urlc = url.openConnection();
                urlc.setUseCaches(false);
                return urlc.getInputStream();
            } catch (IOException e) {
                return null;
            }
        }
        return null;
    }  

This actually *WORKS* for me.

cheers
/dd

PS. I hope that I don't get cursed again.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message