I'm creating DataSource in the jython in wsadmin console in the following way:
First I search for JDBC provider by name:
for provider in AdminConfig.list('JDBCProvider').split('\r\n'):
if AdminConfig.showAttribute(provider, 'name') == providerName:
print 'Found JDBC provider: '+provider
db2provider = provider
The JDBC provider is found. Now I create DataSource using this provider:
dsAttrs = [['name', 'myDS1'], ['jndiName','jdbc/MY/DS1']]
newDs = AdminConfig.create('DataSource', db2provider, dsAttrs)
but I get an exception:
WASX7015E: Exception running command: "newDs = AdminConfig.create('DataSource', db2provider, dsAttrs)"; exception inform ation: com.ibm.websphere.management.exception.ConfigServiceException java.lang.NullPointerException: java.lang.NullPointerException
What is wrong in that code? I'm following the IBM documentation and the examples from internet.
I'm using WebSphere 8.5