Topic
  • 7 replies
  • Latest Post - ‏2011-08-18T13:08:38Z by Emily Jiang
MattMadhavan
MattMadhavan
65 Posts

Pinned topic Bundle Resolution Problem in WAS 7.0

‏2011-08-16T23:24:31Z |
Hello,
one of my persistence bundle has a dependency on the package org.springframework.orm.jpa
When I deployed the bundle I got the following error:

org.springframework.orm.jpa with the version greater than or equal to 3.0.0 required by bundle com.hcsc.itf.osgi.samples.bank.persistence_1.0.0.SNAPSHOT
Updated on 2011-08-18T13:08:38Z at 2011-08-18T13:08:38Z by Emily Jiang
  • MattMadhavan
    MattMadhavan
    65 Posts

    Re: Bundle Resolution Problem in WAS 7.0

    ‏2011-08-16T23:33:41Z  
    I added the required bundle in the bundle repo. I can see the Spring Bundle in the internal bundle repository and see the relevant exported packages also. Please refer to the attached bitmap file.

    Any ideas please?

    Thanks
    Matt
  • Emily Jiang
    Emily Jiang
    73 Posts

    Re: Bundle Resolution Problem in WAS 7.0

    ‏2011-08-17T08:49:34Z  
    Hi Matt,

    The root problem is that the package org.springframework.orm.jpa with the version greater than or equal to 3.0.0 is unavailable. In your bundle of org.springframework.orm, can you have a look at the version of the exported package org.springframework.orm.jpa by clicking the bundle on the internal bundle repository panel? Is it below 3.0.0?

    Regards,
    Emily
  • MattMadhavan
    MattMadhavan
    65 Posts

    Re: Bundle Resolution Problem in WAS 7.0

    ‏2011-08-17T18:07:17Z  
    Hi Matt,

    The root problem is that the package org.springframework.orm.jpa with the version greater than or equal to 3.0.0 is unavailable. In your bundle of org.springframework.orm, can you have a look at the version of the exported package org.springframework.orm.jpa by clicking the bundle on the internal bundle repository panel? Is it below 3.0.0?

    Regards,
    Emily
    Hi Emily,
    The bundle and the required versions are correct. They have been actually Integration tested using PAX Runner. But I did not add the bundle using the console! I just dropped bunch of bundles in the Internal Bundle repository folder.

    Do I need to add them one at a time using the Admin Console? What if I want add bunch of bundles. Adding bundles like this can be excruciating!

    Thanks
    Matt
  • Emily Jiang
    Emily Jiang
    73 Posts

    Re: Bundle Resolution Problem in WAS 7.0

    ‏2011-08-17T21:00:57Z  
    Hi Emily,
    The bundle and the required versions are correct. They have been actually Integration tested using PAX Runner. But I did not add the bundle using the console! I just dropped bunch of bundles in the Internal Bundle repository folder.

    Do I need to add them one at a time using the Admin Console? What if I want add bunch of bundles. Adding bundles like this can be excruciating!

    Thanks
    Matt
    Hi Matt,

    You can zip up the bundles into a .zip file and then upload the zip file into the internal bundle repository.

    Regards
    Emily
  • Graham_Charters
    Graham_Charters
    14 Posts

    Re: Bundle Resolution Problem in WAS 7.0

    ‏2011-08-18T07:28:04Z  
    Hi Matt,

    You can zip up the bundles into a .zip file and then upload the zip file into the internal bundle repository.

    Regards
    Emily
    >> You can zip up the bundles into a .zip file and then upload the zip file into the internal bundle repository.

    I believe this capability is only available on WAS v8, not the Feature Pack on version 7. For version 7 (also works on 8) you would need to write a Jython admin script to call the admin APIs to do the upload. Unfortunately, I don't have a sample for doing this (maybe someone else can provide an example), but WebSphere's Admin console can help. The console has the option to view the script equivalent of the last action you performed. On the right hand side of the admin console you should see:

    Command Assistance
    View administrative scripting command for last action

    The second line is a link that shows the script snippet to include in your batch import script.

    Hope this help.

    Regards, Graham.
  • Graham_Charters
    Graham_Charters
    14 Posts

    Re: Bundle Resolution Problem in WAS 7.0

    ‏2011-08-18T07:30:14Z  
    Hi Emily,
    The bundle and the required versions are correct. They have been actually Integration tested using PAX Runner. But I did not add the bundle using the console! I just dropped bunch of bundles in the Internal Bundle repository folder.

    Do I need to add them one at a time using the Admin Console? What if I want add bunch of bundles. Adding bundles like this can be excruciating!

    Thanks
    Matt
    FYI, dropping bundles into the bundle repository directory won't work because it won't update the repository xml. This directory is considered an implementation detail of our internal repository and so could change from release to release. Please see later comments for how to do batch imports.
  • Emily Jiang
    Emily Jiang
    73 Posts

    Re: Bundle Resolution Problem in WAS 7.0

    ‏2011-08-18T13:08:38Z  
    >> You can zip up the bundles into a .zip file and then upload the zip file into the internal bundle repository.

    I believe this capability is only available on WAS v8, not the Feature Pack on version 7. For version 7 (also works on 8) you would need to write a Jython admin script to call the admin APIs to do the upload. Unfortunately, I don't have a sample for doing this (maybe someone else can provide an example), but WebSphere's Admin console can help. The console has the option to view the script equivalent of the last action you performed. On the right hand side of the admin console you should see:

    Command Assistance
    View administrative scripting command for last action

    The second line is a link that shows the script snippet to include in your batch import script.

    Hope this help.

    Regards, Graham.
    Further to Graham's comments, below is the snippet for your wsdamin script(I call it internalRepo.py).

    AdminTask.addLocalRepositoryBundle('-file jarfullpath1')
    AdminTask.addLocalRepositoryBundle('-file jarfullpath2')
    ... list all files to be uploaded here
    AdminConfig.save()

    where you replace the jarfullpathx with the your jar name together with the full path. Alternatively, you can change the above to a loop to go through a group jars from a directory. I believe you can use 'import os' in the python script and then you can list the jar files from a particular directory.

    After you have written the script, you can save it to a .py file (e.g. internalRepo.py) and then execute the script by cd to the {WAS installation dir}/bin
    Non-Windows: ./wsadmin.sh -lang jython -f internalRepo.py
    Windows: wsadmin -lang jython -f internalRepo.py

    Regards
    Emily