IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 21 replies
  • Latest Post - ‏2011-08-12T08:44:23Z by MarkN
Panchal
Panchal
34 Posts

Pinned topic Feature not yet supported error !

‏2010-06-03T20:18:03Z |
Hi,
I have installed the latest OSGi GA release now. And am happy to report that the BundleContext related error has been fixed in this release.

However, when I tried to update a single bundle within an existing EBA, I get an error message

The exception "CWSAL0051E: An attempt was made to update an OSGi application asset. This is not yet supported. " occurred. Check log for details.

Can you please clarify when this feature would be supported.
Also, can you please confirm if I can update (add/update/delete) an artifact within an EBA while its has been deployed an running as a BLA, Or do I have to stop the BLA undeploy the EBA and redeploy the EBA after updating it.

Thanks in advance for your response.
Updated on 2011-08-12T08:44:23Z at 2011-08-12T08:44:23Z by MarkN
  • MarkN
    MarkN
    124 Posts

    Re: Feature not yet supported error !

    ‏2010-06-04T08:26:54Z  
    Hi Panchal,
    Thank you for confirming that the BundleContext problem was fixed in the GA release.

    As an administrator you can update one or more bundles within an existing EBA providing that the changes are within the ranges specified on each bundle within APPLICATION.MF. (So for example, if you had, Application-Content: bundle.a;version="[1.0.0,2.0.0)"then you could replace bundle.a with any other version from 1.0.0 up to but not including 2.0.0.)

    The way to do this update is not via the 'update asset' button, but rather via Applications -> Application Types -> Assets -> [asset.name.eba] -> Update bundle versions in this application (under the 'Additional properties' heading). This gives you a table listing all the bundles in the application which allows you to make changes accordingly.

    The 'update asset' button is not yet supported, and sadly IBM rules prohibit me saying when it will be. But it's on our list of things to do :)

    You can update one or more bundles within an .eba asset after it has been deployed into a BLA. The changes will take effect once you restart the BLA.
  • Panchal
    Panchal
    34 Posts

    Re: Feature not yet supported error !

    ‏2010-06-09T14:04:44Z  
    • MarkN
    • ‏2010-06-04T08:26:54Z
    Hi Panchal,
    Thank you for confirming that the BundleContext problem was fixed in the GA release.

    As an administrator you can update one or more bundles within an existing EBA providing that the changes are within the ranges specified on each bundle within APPLICATION.MF. (So for example, if you had, Application-Content: bundle.a;version="[1.0.0,2.0.0)"then you could replace bundle.a with any other version from 1.0.0 up to but not including 2.0.0.)

    The way to do this update is not via the 'update asset' button, but rather via Applications -> Application Types -> Assets -> [asset.name.eba] -> Update bundle versions in this application (under the 'Additional properties' heading). This gives you a table listing all the bundles in the application which allows you to make changes accordingly.

    The 'update asset' button is not yet supported, and sadly IBM rules prohibit me saying when it will be. But it's on our list of things to do :)

    You can update one or more bundles within an .eba asset after it has been deployed into a BLA. The changes will take effect once you restart the BLA.
    Hi Mark,
    Thanks for your reply.
    When I click on the "Update Bundle Versions in the application" link it does show me the listing of all the bundles in the application with the last column having only two values viz. "no preference" and "1.0.0" for all my bundles.

    I cannot seem to update my bundle from here.
    Please note that in my APPLICATION.MF, I haven't specified any contents so the Application-Content values are auto generated during import.
  • MarkN
    MarkN
    124 Posts

    Re: Feature not yet supported error !

    ‏2010-06-10T07:54:42Z  
    • Panchal
    • ‏2010-06-09T14:04:44Z
    Hi Mark,
    Thanks for your reply.
    When I click on the "Update Bundle Versions in the application" link it does show me the listing of all the bundles in the application with the last column having only two values viz. "no preference" and "1.0.0" for all my bundles.

    I cannot seem to update my bundle from here.
    Please note that in my APPLICATION.MF, I haven't specified any contents so the Application-Content values are auto generated during import.
    Hi Panchal.
    Here's what you need to do to make best use of the Update Bundle Versions in the application" panel. Rather than have your application manifest autogenerated, write one yourself as per the description in the Infocenter. Once you've deployed your application, install any new bundles, whose versions fall within the ranges set in your application manifest, into the internal bundle repository. Save your changes to the WAS configuration, then revisit the "Update Bundle Versions in the application" panel. You should now be able to select new bundle versions from those in the internal bundle repository that fall into the ranges permitted in your APPLICATION.MF.

    Regards,
    Mark
  • Panchal
    Panchal
    34 Posts

    Re: Feature not yet supported error !

    ‏2010-06-10T21:26:18Z  
    • MarkN
    • ‏2010-06-10T07:54:42Z
    Hi Panchal.
    Here's what you need to do to make best use of the Update Bundle Versions in the application" panel. Rather than have your application manifest autogenerated, write one yourself as per the description in the Infocenter. Once you've deployed your application, install any new bundles, whose versions fall within the ranges set in your application manifest, into the internal bundle repository. Save your changes to the WAS configuration, then revisit the "Update Bundle Versions in the application" panel. You should now be able to select new bundle versions from those in the internal bundle repository that fall into the ranges permitted in your APPLICATION.MF.

    Regards,
    Mark
    Thank for the info. This would mean that we cannot update the bundles if we use the Auto generated Application Context.
  • MarkN
    MarkN
    124 Posts

    Re: Feature not yet supported error !

    ‏2010-06-11T11:52:31Z  
    • Panchal
    • ‏2010-06-10T21:26:18Z
    Thank for the info. This would mean that we cannot update the bundles if we use the Auto generated Application Context.
    Yes, that's correct. We expect most people, most of the time, to author an APPLICATION.MF - it's not onerous, and both the <a href="http://www.ibm.com/developerworks/rational/downloads/10/rationaldevtoolsforosgiapplications.html>free</a> and <a href="https://www14.software.ibm.com/iwm/web/cc/earlyprograms/rational/radob/index.shtml>RAD beta tools provide support for creating one. In its absence we don't like to make assumptions about your versioning strategy. We assume the developer's intent to be that we should install the bundles in the .eba, and not some that we might provision as a result of any guesses about bundle version ranges that we might make.
  • MarkN
    MarkN
    124 Posts

    Re: Feature not yet supported error !

    ‏2010-06-11T11:54:18Z  
    • MarkN
    • ‏2010-06-11T11:52:31Z
    Yes, that's correct. We expect most people, most of the time, to author an APPLICATION.MF - it's not onerous, and both the <a href="http://www.ibm.com/developerworks/rational/downloads/10/rationaldevtoolsforosgiapplications.html>free</a> and <a href="https://www14.software.ibm.com/iwm/web/cc/earlyprograms/rational/radob/index.shtml>RAD beta tools provide support for creating one. In its absence we don't like to make assumptions about your versioning strategy. We assume the developer's intent to be that we should install the bundles in the .eba, and not some that we might provision as a result of any guesses about bundle version ranges that we might make.
    corrected markup
    Yes, that's correct. We expect most people, most of the time, to author an APPLICATION.MF - it's not onerous, and both the free and RAD beta tools provide support for creating one. In its absence we don't like to make assumptions about your versioning strategy. We assume the developer's intent to be that we should install the bundles in the .eba, and not some that we might provision as a result of any guesses about bundle version ranges that we might make.
  • Panchal
    Panchal
    34 Posts

    Re: Feature not yet supported error !

    ‏2010-06-16T00:18:41Z  
    • MarkN
    • ‏2010-06-11T11:54:18Z
    Hi Mark,
    Thanks for your reply.
  • Panchal
    Panchal
    34 Posts

    Re: Feature not yet supported error !

    ‏2010-06-21T21:26:22Z  
    • MarkN
    • ‏2010-06-11T11:54:18Z
    Hello Mark,
    I now modified my APPLICATION.MF file and defined all the application contents explicitly with the version numbers for my bundles as
    
    version=
    "[1.0.0,2.0.0]"
    

    But even with this change, I do not see any way to update my bundles. In the drop-down I still see the same 2 options that I reported in my earlier post. I am not sure how this feature is supposed to work. I think I am missing something here and would really need some kind of a walk-thru document (with images if possible) as to how the 'update bundle versions' feature is supposed to work.

    Thanks.
  • Emily Jiang
    Emily Jiang
    73 Posts

    Re: Feature not yet supported error !

    ‏2010-06-22T09:50:29Z  
    • Panchal
    • ‏2010-06-21T21:26:22Z
    Hello Mark,
    I now modified my APPLICATION.MF file and defined all the application contents explicitly with the version numbers for my bundles as <pre class="jive-pre"> version= "[1.0.0,2.0.0]" </pre>
    But even with this change, I do not see any way to update my bundles. In the drop-down I still see the same 2 options that I reported in my earlier post. I am not sure how this feature is supposed to work. I think I am missing something here and would really need some kind of a walk-thru document (with images if possible) as to how the 'update bundle versions' feature is supposed to work.

    Thanks.
    Hi Panchal,

    For updating bundles, you need to have the same bundle with different versions available to be able to perform update.

    For an example, in you eba, you include a bundle com.bundle.a with version 1.0.0. Later on, you would like to use the bundle com.bundle.a with version 2.0.0. In your application.mf, you have the following:
    com.bundle.a;version="http://1.0.0,2.0.0" in your Application-Content: header. You need to make bundle com.bundle.a version 2.0.0 available for performing update. The instructions are detailed as follows:

    1. Modify the bundle com.bundle.a with your changes on top of your previous version 1.0.0 in your eclipse environment (or RAD or some else IDE tool) and then make its version to be 2.0.0. Its manifest 'META-INF/MANIFEST.MF' looks as bellow:
    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: 0 Plug-in
    Bundle-SymbolicName: com.bundle.a
    Bundle-Version: 2.0.0
    Bundle-Vendor: acom
    Export-Package: LIST THE EXPORT PACKAGES
    Import-Package: LIST THE IMPORT PACKAGES

    2. Upload it to a bundle repository (e.g. internal bundle repository)
    After you have udpated the bundle and its manifest, you need to install the bundle com.bunle.a.jar in the internal bundle repository. Click on Environment->OSGi Bundle Repositories ->Internal Bundle Repository and then on the internal bundle repository screen, click on 'New' button and then on the new screen, browse to your com.bundle.a.jar and upload it.

    3. Go to your asset and then update the bundle com.ibm.a from version 1 to verion 2
    'Update bundle versions in this application' should list both version 1.0.0 and vesion 2.0.0 for bundle com.bundle.a. In the drop own, you just pick the version 2.0.0 and then click 'Preview'. In the preview screen, if anything is ok, just click 'Commit'.

    4. Restart your application.
    The restarting application process will load the new version of bundle com.bundle.a into osgi runtime.
    click on applicaitons-> Application types -> Business Level Applicaions and then choose your application. Click on 'stop' and after the application stoppes, click on 'start'.

    Hope this helps.
    Thanks
    Emily
  • Emily Jiang
    Emily Jiang
    73 Posts

    Re: Feature not yet supported error !

    ‏2010-06-22T09:50:59Z  
    • Panchal
    • ‏2010-06-21T21:26:22Z
    Hello Mark,
    I now modified my APPLICATION.MF file and defined all the application contents explicitly with the version numbers for my bundles as <pre class="jive-pre"> version= "[1.0.0,2.0.0]" </pre>
    But even with this change, I do not see any way to update my bundles. In the drop-down I still see the same 2 options that I reported in my earlier post. I am not sure how this feature is supposed to work. I think I am missing something here and would really need some kind of a walk-thru document (with images if possible) as to how the 'update bundle versions' feature is supposed to work.

    Thanks.
    Hi Panchal,

    For updating bundles, you need to have the same bundle with different versions available to be able to perform update.

    For an example, in you eba, you include a bundle com.bundle.a with version 1.0.0. Later on, you would like to use the bundle com.bundle.a with version 2.0.0. In your application.mf, you have the following:
    com.bundle.a;version="http://1.0.0,2.0.0" in your Application-Content: header. You need to make bundle com.bundle.a version 2.0.0 available for performing update. The instructions are detailed as follows:

    1. Modify the bundle com.bundle.a with your changes on top of your previous version 1.0.0 in your eclipse environment (or RAD or some else IDE tool) and then make its version to be 2.0.0. Its manifest 'META-INF/MANIFEST.MF' looks as bellow:
    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: 0 Plug-in
    Bundle-SymbolicName: com.bundle.a
    Bundle-Version: 2.0.0
    Bundle-Vendor: acom
    Export-Package: LIST THE EXPORT PACKAGES
    Import-Package: LIST THE IMPORT PACKAGES

    2. Upload it to a bundle repository (e.g. internal bundle repository)
    After you have udpated the bundle and its manifest, you need to install the bundle com.bunle.a.jar in the internal bundle repository. Click on Environment->OSGi Bundle Repositories ->Internal Bundle Repository and then on the internal bundle repository screen, click on 'New' button and then on the new screen, browse to your com.bundle.a.jar and upload it.

    3. Go to your asset and then update the bundle com.ibm.a from version 1 to verion 2
    'Update bundle versions in this application' should list both version 1.0.0 and vesion 2.0.0 for bundle com.bundle.a. In the drop own, you just pick the version 2.0.0 and then click 'Preview'. In the preview screen, if anything is ok, just click 'Commit'.

    4. Restart your application.
    The restarting application process will load the new version of bundle com.bundle.a into osgi runtime.
    click on applicaitons-> Application types -> Business Level Applicaions and then choose your application. Click on 'stop' and after the application stoppes, click on 'start'.

    Hope this helps.
    Thanks
    Emily
  • Emily Jiang
    Emily Jiang
    73 Posts

    Re: Feature not yet supported error !

    ‏2010-06-22T09:56:04Z  
    Hi Panchal,

    For updating bundles, you need to have the same bundle with different versions available to be able to perform update.

    For an example, in you eba, you include a bundle com.bundle.a with version 1.0.0. Later on, you would like to use the bundle com.bundle.a with version 2.0.0. In your application.mf, you have the following:
    com.bundle.a;version="http://1.0.0,2.0.0" in your Application-Content: header. You need to make bundle com.bundle.a version 2.0.0 available for performing update. The instructions are detailed as follows:

    1. Modify the bundle com.bundle.a with your changes on top of your previous version 1.0.0 in your eclipse environment (or RAD or some else IDE tool) and then make its version to be 2.0.0. Its manifest 'META-INF/MANIFEST.MF' looks as bellow:
    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: 0 Plug-in
    Bundle-SymbolicName: com.bundle.a
    Bundle-Version: 2.0.0
    Bundle-Vendor: acom
    Export-Package: LIST THE EXPORT PACKAGES
    Import-Package: LIST THE IMPORT PACKAGES

    2. Upload it to a bundle repository (e.g. internal bundle repository)
    After you have udpated the bundle and its manifest, you need to install the bundle com.bunle.a.jar in the internal bundle repository. Click on Environment->OSGi Bundle Repositories ->Internal Bundle Repository and then on the internal bundle repository screen, click on 'New' button and then on the new screen, browse to your com.bundle.a.jar and upload it.

    3. Go to your asset and then update the bundle com.ibm.a from version 1 to verion 2
    'Update bundle versions in this application' should list both version 1.0.0 and vesion 2.0.0 for bundle com.bundle.a. In the drop own, you just pick the version 2.0.0 and then click 'Preview'. In the preview screen, if anything is ok, just click 'Commit'.

    4. Restart your application.
    The restarting application process will load the new version of bundle com.bundle.a into osgi runtime.
    click on applicaitons-> Application types -> Business Level Applicaions and then choose your application. Click on 'stop' and after the application stoppes, click on 'start'.

    Hope this helps.
    Thanks
    Emily
    Hi Panchal,

    In my previous message, the version="http://1.0.0,2.0.0" should be read as what you described in your application.mf. For some reason the version range was rendered to be a url.

    Thanks
    Emily
  • MarkN
    MarkN
    124 Posts

    Re: Feature not yet supported error !

    ‏2010-06-22T10:11:45Z  
    • Panchal
    • ‏2010-06-21T21:26:22Z
    Hello Mark,
    I now modified my APPLICATION.MF file and defined all the application contents explicitly with the version numbers for my bundles as <pre class="jive-pre"> version= "[1.0.0,2.0.0]" </pre>
    But even with this change, I do not see any way to update my bundles. In the drop-down I still see the same 2 options that I reported in my earlier post. I am not sure how this feature is supposed to work. I think I am missing something here and would really need some kind of a walk-thru document (with images if possible) as to how the 'update bundle versions' feature is supposed to work.

    Thanks.
    Hello Panchal,
    For a walk through, please see Zoe Slattery's recent YouTube video, Upgrading an OSGi application.
  • Panchal
    Panchal
    34 Posts

    Re: Feature not yet supported error !

    ‏2010-06-22T14:14:59Z  
    • MarkN
    • ‏2010-06-22T10:11:45Z
    Hello Panchal,
    For a walk through, please see Zoe Slattery's recent YouTube video, Upgrading an OSGi application.
    Hi Mark,
    Thanks for that YouTube Video. That really helped.
    From the video and from Emily's detailed post, its clear what I was missing. Basically, the newer version of the bundle must be present in the 'Internal Bundle Repository' prior to performing an update bundle versions. My expectation was that it would prompt me to upload the newer version of the selected bundles.
    Instead, this way, it would clutter the Internal bundle repository with the newer versions of the application specific bundles in the EBA - which is not preferrable.
    The preferrable way is what is giving me the 'Feature not yet supported' error. So, for the time being I would have to deploy the updated bundles in the Internal Bundle Repository.

    Another point, every update to the bundle version doesn't automatically take effect like it should in an OSGi application - Hot deployment. Instead the BLA has to be stopped and started for the changes to take effect.

    Thanks again for your responses.
  • Panchal
    Panchal
    34 Posts

    Re: Feature not yet supported error !

    ‏2010-06-22T14:17:16Z  
    Hi Panchal,

    For updating bundles, you need to have the same bundle with different versions available to be able to perform update.

    For an example, in you eba, you include a bundle com.bundle.a with version 1.0.0. Later on, you would like to use the bundle com.bundle.a with version 2.0.0. In your application.mf, you have the following:
    com.bundle.a;version="http://1.0.0,2.0.0" in your Application-Content: header. You need to make bundle com.bundle.a version 2.0.0 available for performing update. The instructions are detailed as follows:

    1. Modify the bundle com.bundle.a with your changes on top of your previous version 1.0.0 in your eclipse environment (or RAD or some else IDE tool) and then make its version to be 2.0.0. Its manifest 'META-INF/MANIFEST.MF' looks as bellow:
    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: 0 Plug-in
    Bundle-SymbolicName: com.bundle.a
    Bundle-Version: 2.0.0
    Bundle-Vendor: acom
    Export-Package: LIST THE EXPORT PACKAGES
    Import-Package: LIST THE IMPORT PACKAGES

    2. Upload it to a bundle repository (e.g. internal bundle repository)
    After you have udpated the bundle and its manifest, you need to install the bundle com.bunle.a.jar in the internal bundle repository. Click on Environment->OSGi Bundle Repositories ->Internal Bundle Repository and then on the internal bundle repository screen, click on 'New' button and then on the new screen, browse to your com.bundle.a.jar and upload it.

    3. Go to your asset and then update the bundle com.ibm.a from version 1 to verion 2
    'Update bundle versions in this application' should list both version 1.0.0 and vesion 2.0.0 for bundle com.bundle.a. In the drop own, you just pick the version 2.0.0 and then click 'Preview'. In the preview screen, if anything is ok, just click 'Commit'.

    4. Restart your application.
    The restarting application process will load the new version of bundle com.bundle.a into osgi runtime.
    click on applicaitons-> Application types -> Business Level Applicaions and then choose your application. Click on 'stop' and after the application stoppes, click on 'start'.

    Hope this helps.
    Thanks
    Emily
    Hello Emily,
    Thanks for your detailed post. I found what I was missing - basically the newer version of the bundle must be uploaded to the Internal Bundle Repository prior to performing an update.

    Thanks,
    Panchal.
  • Emily Jiang
    Emily Jiang
    73 Posts

    Re: Feature not yet supported error !

    ‏2010-06-22T14:54:36Z  
    • Panchal
    • ‏2010-06-22T14:17:16Z
    Hello Emily,
    Thanks for your detailed post. I found what I was missing - basically the newer version of the bundle must be uploaded to the Internal Bundle Repository prior to performing an update.

    Thanks,
    Panchal.
    Hi Panchal,

    Great to know it worked. Thanks for your earlier feedback, which will play an important role for improving our future releases.

    Thanks
    Emily
  • SystemAdmin
    SystemAdmin
    153 Posts

    Re: Feature not yet supported error !

    ‏2011-06-16T15:21:45Z  
    • MarkN
    • ‏2010-06-22T10:11:45Z
    Hello Panchal,
    For a walk through, please see Zoe Slattery's recent YouTube video, Upgrading an OSGi application.
    Hi Mark,

    firstly, Thanks for this interesting discussion.

    I know how to update a version of a bundle, but my question is "how can I add a new module, and integrate it in the asset which i deployed it within a bla?" becaufe if I install it in the internal repository, it will be isolated, and it not work if i call a exported service by this bundle.

    Regards,
    Oussama
  • MarkN
    MarkN
    124 Posts

    Re: Feature not yet supported error !

    ‏2011-07-01T08:50:32Z  
    Hi Mark,

    firstly, Thanks for this interesting discussion.

    I know how to update a version of a bundle, but my question is "how can I add a new module, and integrate it in the asset which i deployed it within a bla?" becaufe if I install it in the internal repository, it will be isolated, and it not work if i call a exported service by this bundle.

    Regards,
    Oussama
    Oussama,
    I'm sorry for the delay in getting back to you - I've been waiting for the WAS V8 Infocenter to become available. You can add new bundles to a running application by using the application extension mechanism described here. Services exported by application extensions are available to the bundles in the application that they extend.

    Regards,
    Mark
  • SystemAdmin
    SystemAdmin
    153 Posts

    Re: Feature not yet supported error !

    ‏2011-08-09T10:37:59Z  
    • MarkN
    • ‏2011-07-01T08:50:32Z
    Oussama,
    I'm sorry for the delay in getting back to you - I've been waiting for the WAS V8 Infocenter to become available. You can add new bundles to a running application by using the application extension mechanism described here. Services exported by application extensions are available to the bundles in the application that they extend.

    Regards,
    Mark
    Hi Mark,

    First thank you very much for the perfect answer for my case study, it was really very interesting, and I also apologize for the delay in response because I thought you will not read my post:)

    For this solution Mark, I have two quick questions:

    1-If I add an extension (cba) to an eba, which provides services and resources, services will be accessible through the bundles of the EBA, and it works fine but when I want to access the resources saved by one of Bundle of cba in the HTTPService service, I can't, is that you have an idea for this problem?

    2-what is the maximum number of bundles that can contain eba?

    Regards,
    Oussama
  • MarkN
    MarkN
    124 Posts

    Re: Feature not yet supported error !

    ‏2011-08-09T12:56:21Z  
    Hi Mark,

    First thank you very much for the perfect answer for my case study, it was really very interesting, and I also apologize for the delay in response because I thought you will not read my post:)

    For this solution Mark, I have two quick questions:

    1-If I add an extension (cba) to an eba, which provides services and resources, services will be accessible through the bundles of the EBA, and it works fine but when I want to access the resources saved by one of Bundle of cba in the HTTPService service, I can't, is that you have an idea for this problem?

    2-what is the maximum number of bundles that can contain eba?

    Regards,
    Oussama
    Hi Oussama,
    I'm glad to hear that you've had some success in working with extensions.

    when I want to access the resources saved by one of Bundle of cba in the HTTPService service, I can't,

    I think I'm going to need some more information. First of all, can I ask, is this a problem specific to HTTPService? Does this problem also affect Web Application Bundles, WABs? I know that Servlets inside WABs inside CBAs deployed as extensions work correctly; it's possible that HTTPService-style access has received less attention.

    Please see if packaging your Servlets into WABs fixes your problem, and then let us know either way. I think we'll need quite a bit more information in order to be able to assist you properly.

    Finally, I'm not aware of any absolute limit on the number of bundles that can be included within an EBA.

    Regards,
    Mark
  • SystemAdmin
    SystemAdmin
    153 Posts

    Re: Feature not yet supported error !

    ‏2011-08-10T10:23:32Z  
    • MarkN
    • ‏2011-08-09T12:56:21Z
    Hi Oussama,
    I'm glad to hear that you've had some success in working with extensions.

    when I want to access the resources saved by one of Bundle of cba in the HTTPService service, I can't,

    I think I'm going to need some more information. First of all, can I ask, is this a problem specific to HTTPService? Does this problem also affect Web Application Bundles, WABs? I know that Servlets inside WABs inside CBAs deployed as extensions work correctly; it's possible that HTTPService-style access has received less attention.

    Please see if packaging your Servlets into WABs fixes your problem, and then let us know either way. I think we'll need quite a bit more information in order to be able to assist you properly.

    Finally, I'm not aware of any absolute limit on the number of bundles that can be included within an EBA.

    Regards,
    Mark
    Hi Mark,

    Thank you very much Mark for these answers relevant, I will detail my case a bit ...

    I have a eba containing several bundles, one bundle, where his web web.xml has the form:

    
    <servlet> <servlet-name>HttpServiceServlet</servlet-name> <servlet-class>org.eclipse.equinox.http.servlet.HttpServiceServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>HttpServiceServlet</servlet-name> <url-pattern>
    /*</url-pattern> </servlet-mapping>
    


    and other bundles will save resources so that they are accessible (eg text file) with the following configuration:

    Java :

    
    
    
    package org.osgi.was.main.internal;   
    
    import java.util.logging.Level; 
    
    import java.util.logging.Logger;   
    
    import org.osgi.service.http.HttpService; 
    
    import org.osgi.service.http.NamespaceException; 
    
    public 
    
    class MainServletRegistry 
    { 
    
    private 
    
    static 
    
    final Logger logger = Logger.getLogger(MainServletRegistry.class.getName()); 
    
    public 
    
    void bindServlet(HttpService service) 
    { 
    
    if (
    
    null != service) 
    { 
    
    try 
    { logger.log(Level.INFO, 
    "HTTP Service bound: " + service); service.registerResources(
    "/Readme.txt", 
    "/Target/Readme.txt", 
    
    null); 
    } 
    
    catch (NamespaceException e) 
    { logger.log(Level.WARNING,
    "Unable to register example servlet!", e); 
    } 
    } 
    } 
    
    public 
    
    void unbindServlet(HttpService service) 
    { 
    
    if (
    
    null != service) 
    { logger.log(Level.INFO, 
    "HTTP Service unbound: " + service); service.unregister(
    "/Readme.txt"); 
    } 
    } 
    }
    


    Blueprint.xml

    
    <bean id=
    "MainServletRegistry" class=
    "org.osgi.was.main.internal.MainServletRegistry" />   <reference interface=
    "org.osgi.service.http.HttpService" activation=
    "eager" availability=
    "optional"> <reference-listener bind-method=
    "bindServlet" unbind-method=
    "unbindServlet" ref=
    "MainServletRegistry" /> </reference>
    


    and if I want to get to the link http://localhost:9080/Context/Readme.txt, it works fine, but if I add an extension that contains the same structure (a resource service + "Readmetest.txt") the resource is not accessible if I type http://localhost:9080/Context/Readmetest.txt by against the service is imported by the bundles of eba.

    I would like this information will clarify the situation.

    Again Thank you for your support, your advice was rich.

    Regards,
    Oussama
  • MarkN
    MarkN
    124 Posts

    Re: Feature not yet supported error !

    ‏2011-08-12T08:44:23Z  
    Hi Mark,

    Thank you very much Mark for these answers relevant, I will detail my case a bit ...

    I have a eba containing several bundles, one bundle, where his web web.xml has the form:

    <pre class="jive-pre"> <servlet> <servlet-name>HttpServiceServlet</servlet-name> <servlet-class>org.eclipse.equinox.http.servlet.HttpServiceServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>HttpServiceServlet</servlet-name> <url-pattern> /*</url-pattern> </servlet-mapping> </pre>

    and other bundles will save resources so that they are accessible (eg text file) with the following configuration:

    Java :

    <pre class="jive-pre"> package org.osgi.was.main.internal; import java.util.logging.Level; import java.util.logging.Logger; import org.osgi.service.http.HttpService; import org.osgi.service.http.NamespaceException; public class MainServletRegistry { private static final Logger logger = Logger.getLogger(MainServletRegistry.class.getName()); public void bindServlet(HttpService service) { if ( null != service) { try { logger.log(Level.INFO, "HTTP Service bound: " + service); service.registerResources( "/Readme.txt", "/Target/Readme.txt", null); } catch (NamespaceException e) { logger.log(Level.WARNING, "Unable to register example servlet!", e); } } } public void unbindServlet(HttpService service) { if ( null != service) { logger.log(Level.INFO, "HTTP Service unbound: " + service); service.unregister( "/Readme.txt"); } } } </pre>

    Blueprint.xml

    <pre class="jive-pre"> <bean id= "MainServletRegistry" class= "org.osgi.was.main.internal.MainServletRegistry" /> <reference interface= "org.osgi.service.http.HttpService" activation= "eager" availability= "optional"> <reference-listener bind-method= "bindServlet" unbind-method= "unbindServlet" ref= "MainServletRegistry" /> </reference> </pre>

    and if I want to get to the link http://localhost:9080/Context/Readme.txt, it works fine, but if I add an extension that contains the same structure (a resource service + "Readmetest.txt") the resource is not accessible if I type http://localhost:9080/Context/Readmetest.txt by against the service is imported by the bundles of eba.

    I would like this information will clarify the situation.

    Again Thank you for your support, your advice was rich.

    Regards,
    Oussama
    Hi Oussama,

    +but if I add an extension that contains the same structure (a resource service + "Readmetest.txt") the resource is not accessible+

    First of all, can you please confirm whether or not service.registerResources() is being called inside your bind-method when running inside an extension? In other words, is 'service' null or not? If 'service' is null, then it's probably an application assembly error, such as a missing CompositeBundle-ImportService entry in your COMPOSITEBUNDLE.MF. If service.registerResources() is being called inside the CBA, then you'll need to follow the thread of execution down into your org.osgi.service.http.HttpService provider to see what's going on.

    Regards,
    Mark