You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Jack Cai (JIRA)" <ji...@apache.org> on 2009/08/27 10:12:59 UTC

[jira] Updated: (GERONIMO-4785) "useCaches" property of JarFileUrlConnection doesn't work

     [ https://issues.apache.org/jira/browse/GERONIMO-4785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jack Cai updated GERONIMO-4785:
-------------------------------

    Attachment: GERONIMO-4785.patch

This patch applies to both 2.1 and 2.2. Built well. 

I intentionally set the default value of useCaches to false, so that all the URLConnection instances will not use a cache (including our JarFileUrlConnection). All the tests passed.


> "useCaches" property of JarFileUrlConnection doesn't work
> ---------------------------------------------------------
>
>                 Key: GERONIMO-4785
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4785
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: kernel
>    Affects Versions: 2.1.4
>         Environment: Sun JDK 1.5.0.19
>            Reporter: Masayoshi Yamashita
>         Attachments: GERONIMO-4785.patch
>
>
> When executing the following code on Geronimo server,
> =====================================================================
> ClassLoader loader = Thread.currentThread().getContextClassLoader();
> URL url = loader.getResource("javax/servlet/http/");
> JarURLConnection conn1 = (JarURLConnection) url.openConnection();
> conn1.setUseCaches(false);
> JarFile jarFile1 = conn1.getJarFile();
> JarURLConnection conn2 = (JarURLConnection) url.openConnection();
> conn2.setUseCaches(false);
> JarFile jarFile2 = conn2.getJarFile();
> System.out.println(jarFile1);
> System.out.println(jarFile2);
> =====================================================================
> there is a problem that "jarFile1" and "jarFile2" are same instances.
> Also, it is described in the javadoc of "useCaches" field as follows.
> "If false, the protocol must always try to get a fresh copy of the object."
> "org.apache.geronimo.kernel.classloader.JarFileUrlConnection" must return a different instance, when "useCaches" is false.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.