Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.0, 3.0-beta-2
    • Component/s: deployment
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      Resource lookup in Geronimo 3.0 returns "bundle" type of urls. However, a lot of Geronimo code and a number of third party libraries assumes that urls returned by resource lookup return "jar" or "file" type of urls. Because of this difference a lot of applications might not work properly on Geronimo 3.0. The Geronimo specific code has mostly been updated to use OSGi-friendly ways to look for resources. However, we can't expect every 3rd party library to be updated to be OSGi friendly. So we might need a solution that can return "jar" or "file" urls that works with most libraries.

      One possible solution is to use the BundleResourceClassLoader in the xbean-bundleutils project (currently used in the OpenJPA plugin). That solution could be enhanced with Equinox-specific extension (URLConverter service) that can convert "bundle" urls directly into "jar" or "file" urls (using the jars in its bundle cache).

        Activity

        Hide
        Jarek Gawor added a comment -

        Proposed patch for this issue. The patch uses Equinox's classloader hook to return a custom classloader that 1) uses Equinox's URLConversion service to translate "bundle" urls into "jar" urls, 2) extends URLClassLoader class - therefore allows applications that assume TCCL to be a URLClassLoader to still run ok (potentially) and 3) supports searching for META-INF/ resources in statically wired bundles.

        Show
        Jarek Gawor added a comment - Proposed patch for this issue. The patch uses Equinox's classloader hook to return a custom classloader that 1) uses Equinox's URLConversion service to translate "bundle" urls into "jar" urls, 2) extends URLClassLoader class - therefore allows applications that assume TCCL to be a URLClassLoader to still run ok (potentially) and 3) supports searching for META-INF/ resources in statically wired bundles.
        Hide
        Jarek Gawor added a comment -

        A new version of the patch.

        Show
        Jarek Gawor added a comment - A new version of the patch.
        Hide
        Jarek Gawor added a comment -

        Updated the patch with additional changes to geronimo-kernel module.

        Show
        Jarek Gawor added a comment - Updated the patch with additional changes to geronimo-kernel module.
        Hide
        Jarek Gawor added a comment -

        Latest patch with additional improvements so that the user can override the searchWiredBundles and convertResourceUrl default settings using system properties. For now used the same property names as in XBEAN-164.

        Show
        Jarek Gawor added a comment - Latest patch with additional improvements so that the user can override the searchWiredBundles and convertResourceUrl default settings using system properties. For now used the same property names as in XBEAN-164 .
        Hide
        Jarek Gawor added a comment -

        Minor fix (wrong protection domain passed to the classloader).

        Show
        Jarek Gawor added a comment - Minor fix (wrong protection domain passed to the classloader).
        Hide
        Jarek Gawor added a comment -

        Another fix. Override ClassLoader.findResources() instead of getResources() as JVMs call different methods to search for resources.

        Show
        Jarek Gawor added a comment - Another fix. Override ClassLoader.findResources() instead of getResources() as JVMs call different methods to search for resources.
        Hide
        Jarek Gawor added a comment -

        I committed the patch with some additional changes / simplifications to trunk in revision 1138728. By default the Equinox-specific classloader is not enabled. It can be enabled by setting the "org.apache.geronimo.equinox.useURLClassLoader" system property to "true". We can change this default in the future after a bit more testing.

        Show
        Jarek Gawor added a comment - I committed the patch with some additional changes / simplifications to trunk in revision 1138728. By default the Equinox-specific classloader is not enabled. It can be enabled by setting the "org.apache.geronimo.equinox.useURLClassLoader" system property to "true". We can change this default in the future after a bit more testing.
        Hide
        Shawn Jiang added a comment -

        Since more an more 3rd app need to set this properties to work correctly. We need to set default "org.apache.geronimo.equinox.useURLClassLoader" system property to "true".

        the first step would to do a TCK with this option on.

        Show
        Shawn Jiang added a comment - Since more an more 3rd app need to set this properties to work correctly. We need to set default "org.apache.geronimo.equinox.useURLClassLoader" system property to "true". the first step would to do a TCK with this option on.
        Hide
        Forrest Xia added a comment -

        Can we close this jira?

        Show
        Forrest Xia added a comment - Can we close this jira?

          People

          • Assignee:
            Unassigned
            Reporter:
            Jarek Gawor
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development