myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Han Hong Fang (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (MYFACES-2947) application configuration resources located in lib/*.jar can not be accessed in OSGi enviroment
Date Tue, 19 Oct 2010 06:02:27 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-2947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922450#action_12922450
] 

Han Hong Fang commented on MYFACES-2947:
----------------------------------------

Thanks Ivan for pointing me to SPI FacesConfigResourceProvider interface.



> application configuration resources located in lib/*.jar can not be accessed in OSGi
enviroment
> -----------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-2947
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2947
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.0, 2.0.2
>            Reporter: Han Hong Fang
>
> In OSGi environment, BundleClassLoader is used to get jar file resource. , and the conn
(refer the code below) is BundleURLConnection, and will never be JarURLConnection. This causes
faces configuration files under jar file can not be accessed in OSGi environment. 
> Code segment from myfaces-impl-2.0.2-sources\org\apache\myfaces\view\facelets\util\Classpath.java
> for (  Enumeration<URL> urls = loader.getResources(resource); urls.hasMoreElements();
  )
>         {
>             URL url = urls.nextElement();
>             URLConnection conn = url.openConnection();
>             conn.setUseCaches(false);
>             conn.setDefaultUseCaches(false);
>             JarFile jar;
>             if (conn instanceof JarURLConnection)
>             {
>                 jar = ((JarURLConnection) conn).getJarFile();
>             }
>             else
>             {
>                 jar = _getAlternativeJarFile(url);
>             }
>             if (jar != null)
>             {
>                 _searchJar(loader, result, jar, prefix, suffix);
>             }
>             else
>             {
>                 if (!_searchDir(result, new File(URLDecoder.decode(url.getFile(), "UTF-8")),
suffix))
>                 {
>                     _searchFromURL(result, prefix, suffix, url);
>                 }
>             }
>         }

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


Mime
View raw message