Based on IBM documentation, I wrote a jython script that adds shared libs to an existing application.
# Application name
app = sys.argv[0]
dep = AdminConfig.getid('/Deployment:' + app + '/')
depObject = AdminConfig.showAttribute(dep, 'deployedObject')
classldr = AdminConfig.showAttribute(depObject, 'classloader')
for x in range(1, len(sys.argv)):
AdminConfig.create('LibraryRef', classldr,
[['libraryName', sys.argv[x]], ['sharedClassloader', 'true']])
AdminConfig.save()
Unfortunately, this is setting the shared library only for the application and not for the modules. How could I achieve setting the libraries for both ?
I tried to get the modules of an application but I cannot get the classloader of it.
BTW, what is the sharedClassloader
attributes used for ?
Note: I know this is bad practice, but I inherited a bunch of legacy applications, so please don't advice to get rid of shared libs or to add a deployment.xml