Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2947

application configuration resources located in lib/*.jar can not be accessed in OSGi enviroment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.0.0, 2.0.2
    • 2.0.3
    • General
    • None

    Description

      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); }

      }
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            hanhongfang Hong Fang Han
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: