Uploaded image for project: 'JBoss OSGi'
  1. JBoss OSGi
  2. JBOSGI-794

WAB Fragment resources are not available through host

    Details

      Description

      Actually my bundle-fragment gives me no possibility to load extra resources from it. I get only 404 when try to load /budget/portal/resources/angular-material/1.0.7/angular-material.css. I have found in log, that it was created an osgi-storage for my bundle-fragment withe start=false. Is it correct so? May be you could give me some advices, how to make it work.


      OSGI EE spec is as follows:

      128.6.3 Resource Lookup
      The getResource and getResourceAsStream methods of the ServletContext interface are used to access resources in the web application. For a WAB, these resources must be found according to the findEntries method, this method includes fragments. For the getResource and getResourceAsStream method, if multiple resources are found, then the first one must be used.
      Since the getResource and getResourceAsStream methods do not support wildcards while the findEntries method does it is necessary to escape the wildcard asterisk (’’ \u002A) with prefixing it with a reverse solidus (backslash ’\’ \u005C). This implies that a reverse solidus must be escaped with an extra reverse solidus. For example, the path foo\bar must be escaped to foo
      bar*.
      The getResourcePaths method must map to the Bundle getEntryPaths method, its return type is a Set and can not handle multiples. However, the paths from the getEntryPaths method are relative while the methods of the getResourcePaths must be absolute.
      For example, assume the following manifest for a bundle:
      Bundle-ClassPath: localized, WEB-INF
      ...
      This WAB has an attached fragment acme-de.jar with the following content:
      META-INF/MANIFEST.MF
      localized/logo.png

      The getResource method for localized/logo.png uses the findEntries method to find a resource in the directory /localized and the resource logo.png. Assuming the host bundle has no localized/ directory, the Web Runtime must serve the logo.png resource from the acme-de.jar.


      Default Undertow servlet delegates to ServletResourceManager.getResource() that goes straight for the physical path, bypassing OSGi entirely.


      WarMetadata.setOverlays() should provide necessary overlay handling for ServletResourceManager.getResource()


      IMPORTANT: If host depends on the fragment, capabilities MUST be used to ensure proper ordering
      See: http://stackoverflow.com/questions/11029768/when-is-an-osgi-fragment-attached-to-host

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  arcivanov Arcadiy Ivanov
                  Reporter:
                  arcivanov Arcadiy Ivanov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: