I am trying to create jmsprovider resource using wsadmin as show below in WAS ND installed version

  1. Setting the scope to TestDmgrNode

wsadmin>AdminConfig.getid('/Node:TestDmgrNode/') 'TestDmgrNode(cells/TestCell/nodes/TestDmgrNode|node.xml#Node_1)'

  1. Adding JMSProvider at above scope

wsadmin>AdminConfig.create('JMSProvider', node, [['name', 'TestProvider1'], ['description', 'TestProvider1'], ['classpath', '/var/tmp/test.jar'], ['externalInitialContextFactory', 'testICF'], ['externalProviderURL', 'testexternalurl']]) 'TestProvider1(cells/TestCell/nodes/TestDmgrNode|resources.xml#JMSProvider_1517482261206)' wsadmin>AdminConfig.save()

Once, i have saved the configuration i am able to see the resource in under JMS Provider section, Now i tried to run the same command again and it saves the same resource again without throwing any Exception that a resource with 'name' already exists.

wsadmin>AdminConfig.create('JMSProvider', node, [['name', 'TestProvider1'], ['description', 'TestProvider1'], ['classpath', '/var/tmp/test.jar'], ['externalInitialContextFactory', 'testICF'], ['externalProviderURL', 'testexternalurl']])


Could anybody guide if its related any bug in the version that is installed

Note - When i try to add the same resource again using the admin console it is throwing error.

Please suggest Thanks Sudhir


Yes, I was able to reproduce what you've described and it should be reported as a bug because of the inconsistent behavior between wsadmin and Admin Console. As a simple workaround, before creating the JMSProvider, check for the presence of any JMSProvider with the same name as your new JMSProvider at the same scope at which you're creating the new one. As an example:

def jmsProviderExists(scope, jmspName):
    #print 'JMSProviders' + AdminConfig.list('JMSProvider',scope)
    jps = AdminConfig.list('JMSProvider',scope).splitlines()
    #print jps
    for jp in jps:
        #print jp
        name = AdminConfig.showAttribute(jp, 'name')
        if name == jmspName:
            return True
    return False

node = AdminConfig.getid('/Node:DefaultNode01/')
#print 'Node:' + node
if jmsProviderExists(node, intendedName):
    print 'JMSProvider with name already exists'
    print 'Create JMSProvider'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.