Topic
  • 2 replies
  • Latest Post - ‏2011-09-08T19:44:14Z by izhd
MattMadhavan
MattMadhavan
65 Posts

Pinned topic Adding Bundles to WAS's internal bundle repository

‏2011-08-17T18:21:04Z |
Hello,
Whats the best way to add bundles to the internal repository of WAS. I have lots of bundles to add. Adding bundles one at a time using the Admin console can be excruciating. Can I just drop in all my bundles in the folder.

Or is there any easier way to deploy bunch of bundles on the internal repo?

Thanks
Matt
Updated on 2011-09-08T19:44:14Z at 2011-09-08T19:44:14Z by izhd
  • izhd
    izhd
    17 Posts

    Re: Adding Bundles to WAS's internal bundle repository

    ‏2011-09-08T19:41:43Z  
    Hi Matt,

    You can use Jython script

    def installSharedBundle(bundleName, bundleLocation):
    print "Install bundle " + bundleName

    localBundles = AdminTask.listLocalRepositoryBundles().splitlines()
    if bundleName in localBundles:
    print "bundle already installed"
    else:
    print "Adding bundle to the Internal Bundle Repository"
    AdminTask.addLocalRepositoryBundle('')
    print 'Completed'
    print ''

    #######################################################################

    def installSharedBundles(sharedBundlesLocation):
    print "Install shared bundles "
    installSharedBundle('com.ibm.json.java;1.7.0',sharedBundlesLocation+'json4j.jar')
    installSharedBundle('com.ibm.websphere.rpcadapter;1.0.1.1',sharedBundlesLocation+'com.ibm.websphere.rpcadapter_1.0.1.1.jar')

    AdminConfig.save()
  • izhd
    izhd
    17 Posts

    Re: Adding Bundles to WAS's internal bundle repository

    ‏2011-09-08T19:44:14Z  
    • izhd
    • ‏2011-09-08T19:41:43Z
    Hi Matt,

    You can use Jython script

    def installSharedBundle(bundleName, bundleLocation):
    print "Install bundle " + bundleName

    localBundles = AdminTask.listLocalRepositoryBundles().splitlines()
    if bundleName in localBundles:
    print "bundle already installed"
    else:
    print "Adding bundle to the Internal Bundle Repository"
    AdminTask.addLocalRepositoryBundle('')
    print 'Completed'
    print ''

    #######################################################################

    def installSharedBundles(sharedBundlesLocation):
    print "Install shared bundles "
    installSharedBundle('com.ibm.json.java;1.7.0',sharedBundlesLocation+'json4j.jar')
    installSharedBundle('com.ibm.websphere.rpcadapter;1.0.1.1',sharedBundlesLocation+'com.ibm.websphere.rpcadapter_1.0.1.1.jar')

    AdminConfig.save()
    The post lost all indentations - please keep in mind that Jython using indentations for procedure body, "if", etc