Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.2
    • Component/s: osgi
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      Some install/uninstall action should be done via OSGI API or Karaf functions more easily.

        Activity

        Hide
        Ivan added a comment -

        While playing with the geronimo-framework, I found that by default, felix will cache the bundles in the cache folder, and just replace the files in the repository will not affect those ones in the cache folder, so even after restarting the server, those files in the cache are not refreshed.
        1. We should call the OSGI api to install/refresh files in the cache while we deploy/redeploy Java EE applications in the future.
        2. With the cache working, it seems that if the repository occupies 50 M, we will need another 50M disk space as the cache, not sure whether it is acceptable.
        Thanks for any comment !

        Show
        Ivan added a comment - While playing with the geronimo-framework, I found that by default, felix will cache the bundles in the cache folder, and just replace the files in the repository will not affect those ones in the cache folder, so even after restarting the server, those files in the cache are not refreshed. 1. We should call the OSGI api to install/refresh files in the cache while we deploy/redeploy Java EE applications in the future. 2. With the cache working, it seems that if the repository occupies 50 M, we will need another 50M disk space as the cache, not sure whether it is acceptable. Thanks for any comment !
        Hide
        David Jencks added a comment -

        I thought I had managed to configure the pax maven url handler to use bundle references rather than copying the bundle into data. If I failed, hopefully it will be easy to fix.

        I don't think that osgi should install everything in the repository. This would make the client container unmanageable for instance. osgi install bundle is not AFAICT equivalent to any existing geronimo lifecycle phase. To me it seems like a new stage before starting the configuration gbean. In any case, osgi install should only happen when we are trying to start a particular geronimo plugin.

        Show
        David Jencks added a comment - I thought I had managed to configure the pax maven url handler to use bundle references rather than copying the bundle into data. If I failed, hopefully it will be easy to fix. I don't think that osgi should install everything in the repository. This would make the client container unmanageable for instance. osgi install bundle is not AFAICT equivalent to any existing geronimo lifecycle phase. To me it seems like a new stage before starting the configuration gbean. In any case, osgi install should only happen when we are trying to start a particular geronimo plugin.
        Hide
        Ivan added a comment -

        If you mean the " use bundle reference" is something like "file link", I did not think it works now. In the cache folder, I could see all the installed bundles that running in the OSGI. Actually, it is managed by Felix IIRC, and the repository folder is managed by Karaf. Will have a close look at it later.

        Show
        Ivan added a comment - If you mean the " use bundle reference" is something like "file link", I did not think it works now. In the cache folder, I could see all the installed bundles that running in the OSGI. Actually, it is managed by Felix IIRC, and the repository folder is managed by Karaf. Will have a close look at it later.
        Hide
        Ivan added a comment -

        Commit the first step change to use file reference for the bundle installation. Some changes may need to determine whether the bundle is loaded.

        Show
        Ivan added a comment - Commit the first step change to use file reference for the bundle installation. Some changes may need to determine whether the bundle is loaded.
        Hide
        Ivan added a comment -

        After enabling the file reference configuration, I got many Bundle symbolic name and version are not unique Exception.
        For in the startup.properties, mvn url is used for the bundle installation, so just by comparing the getLocation() is not enough here.
        Since in Geronimo, all the bundles are mananged in mvn style, I think we could use artifact to do the comparation by parsing the mvn url location.
        Any comment ?

        Show
        Ivan added a comment - After enabling the file reference configuration, I got many Bundle symbolic name and version are not unique Exception. For in the startup.properties, mvn url is used for the bundle installation, so just by comparing the getLocation() is not enough here. Since in Geronimo, all the bundles are mananged in mvn style, I think we could use artifact to do the comparation by parsing the mvn url location. Any comment ?
        Hide
        David Jencks added a comment -

        I'm confused. After seeing thousands of these exceptions, I got rid of them by always using the mvn urls and checking the locations of each installed bundle for duplicates before trying to install. As a result of this experience I think it is essential that we only use mvn urls for all bundles we install into osgi. Do you see problems if you use mvn urls everywhere?

        Show
        David Jencks added a comment - I'm confused. After seeing thousands of these exceptions, I got rid of them by always using the mvn urls and checking the locations of each installed bundle for duplicates before trying to install. As a result of this experience I think it is essential that we only use mvn urls for all bundles we install into osgi. Do you see problems if you use mvn urls everywhere?
        Hide
        Ivan added a comment -

        I agree that use a unique url style is better, and mvn url is truely a good choice, but the question is that Felix has different strategy depending on the url styles. Internally, it supports three url styles : reference:file, file, inputstream, it only uses the file link (not copy bundles to the cache folder) while the location is of reference:file style. Currently, when Geronimo is started, the mvn url is used, then Felix will copy the bundle from inputstream to its cache folder. So far, I did not see a way to make both mvn url and reference file active.

        We may have a better way to check whether the bundle is installed, since we only use mvn style url now, we could directly call the install the bundle and depending on the state of the returned bundle object, we could decide whether or not need to call the start action.

        If we use different url style to disable the cache function in the future, we may need other ways to find whether corresponding bundle is installed or not, to keep a installed artifact list is one of the choices. Another side, we may need a flag in the META-INF of the bundles to decide which style will be used (Copy Or Not Copy). From some discussion of Felix forum, while using the file reference style, there will be some problems about loading native libraries.

        Any comment ?

        Show
        Ivan added a comment - I agree that use a unique url style is better, and mvn url is truely a good choice, but the question is that Felix has different strategy depending on the url styles. Internally, it supports three url styles : reference:file, file, inputstream, it only uses the file link (not copy bundles to the cache folder) while the location is of reference:file style. Currently, when Geronimo is started, the mvn url is used, then Felix will copy the bundle from inputstream to its cache folder. So far, I did not see a way to make both mvn url and reference file active. We may have a better way to check whether the bundle is installed, since we only use mvn style url now, we could directly call the install the bundle and depending on the state of the returned bundle object, we could decide whether or not need to call the start action. If we use different url style to disable the cache function in the future, we may need other ways to find whether corresponding bundle is installed or not, to keep a installed artifact list is one of the choices. Another side, we may need a flag in the META-INF of the bundles to decide which style will be used (Copy Or Not Copy). From some discussion of Felix forum, while using the file reference style, there will be some problems about loading native libraries. Any comment ?
        Hide
        David Jencks added a comment -

        I think we need to modify the pax-mvn-url code to send reference urls to felix (or whatever else is needed).

        For native libraries, there must be a better solution than copying the whole bundle. I'm just not worried about this yet.

        Show
        David Jencks added a comment - I think we need to modify the pax-mvn-url code to send reference urls to felix (or whatever else is needed). For native libraries, there must be a better solution than copying the whole bundle. I'm just not worried about this yet.
        Hide
        Ivan added a comment -

        Change the JIRA name to reflect the actual thread that JIRA is talked about.

        Show
        Ivan added a comment - Change the JIRA name to reflect the actual thread that JIRA is talked about.
        Hide
        Ivan added a comment -

        I asked it in Felix forum, seems that while mvn style protocol is used, Felix will read the bundle from the stream, then save it in the cache.
        http://old.nabble.com/Change-the-behavior-of-the-bundle-installation-with-mvn-url-protocol-td26108064.html
        So it seems that if we need to enable the file reference in OSGI to avoid file copying, the only way I could see is to use reference:file url for bundle installation. But if we do that, we can not use location to identify the bundle, for two urls may point to the same bundle.

        Show
        Ivan added a comment - I asked it in Felix forum, seems that while mvn style protocol is used, Felix will read the bundle from the stream, then save it in the cache. http://old.nabble.com/Change-the-behavior-of-the-bundle-installation-with-mvn-url-protocol-td26108064.html So it seems that if we need to enable the file reference in OSGI to avoid file copying, the only way I could see is to use reference:file url for bundle installation. But if we do that, we can not use location to identify the bundle, for two urls may point to the same bundle.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ivan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development