geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Han Hong Fang (JIRA)" <>
Subject [jira] Updated: (GERONIMO-5536) application configuration resources located in lib/*.jar can not be accessed by myfaces in OSGi enviroment
Date Wed, 18 Aug 2010 03:27:16 GMT


Han Hong Fang updated GERONIMO-5536:

    Attachment: GERONIMO-5536.patch

In JSF spec, faces configuration resources are divided into two categories (ref to spec chapter

category 1. applicatonConfigurationResource, includes
 - META-INF/faces-config.xml
 - META-INF/*.faces-config.xml
 - param value of param name javax.faces.CONFIG_FILES in context init params

Category 2. applicationFacesConfig
 - /WEB-INF/faces-config.xml

When parsing the application configuration resources, applicationConfigurationResources are
parsed before applicationFacesConfig.

The problem in this JIRA is that, when META-INF/faces-config.xml and META-INF/*.faces-config.xml
in category 1 locate in a jar file, they can not be access by myfaces in Geronimo 3.0.

A workaround is provided by the patch with following implementation detail:

- check the existance of META-INF/faces-config.xml and META-INF/*.faces-config.xml in all
jars in lib folder
- if such configuration files exist, copy them to a temp dir in the basedir
- add temp file locations into the param value of  javax.faces.CONFIG_FILES to make sure they
are included by myfaces during configuration processing.

Please help to review. Thanks in advance.

> application configuration resources located in lib/*.jar can not be accessed by myfaces
in OSGi enviroment
> ----------------------------------------------------------------------------------------------------------
>                 Key: GERONIMO-5536
>                 URL:
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: myfaces
>    Affects Versions: 3.0
>            Reporter: Han Hong Fang
>            Assignee: Han Hong Fang
>         Attachments: GERONIMO-5536.patch
> Myfaces uses classloader to get jar file resource. In OSGi environment, bundleclassloader
is used, and the conn (refer the code below) will never be JarURLConnection. This causes faces
configuration files under jar file can not be accessed by myfaces in Geronimo 3.0.
> 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)
> ....
> }

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

View raw message