Search code examples
webspherejythonwsadmin

wsadmin obtain server name of an application stopped


This is my first question and I think this is not the last.

for start a application with wsadmin I need the name of the server.

    appManager = AdinControl.completeObjectName('type=ApplicationManager,process='+serverName+',*')
    AdminControl.invoke(appManager,'startApplication',myAppName)

I know how to obtain the name server when the application is started but not when is stopped.

Could you help me please.

Best regards Jean-Christophe


Solution

  • I think that I've find a solution, but I don't know if its works with dmgr (I'm on holiday, I've tested with WAS 8.5.5 trial version). I've understood that AdminControl works with active applications objects, therefore my first test can't works to start my application.

    app = raw_input("Donner le nom de l'application a demarree: ")
    
    print "recuperation du nom de server"
    mods = AdminApp.listModules(app,'-server')
    ( name, module, server ) = mods.split( '#' )
    serverName = server.split( '=' ) [ -1 ] #quite ugly, If you have best solution, I take
    
    appManager= AdminControl.completeObjectName('type=ApplicationManager,process='+serverName+',*')
    
    print "Demarrage d'une application :"
    AdminControl.invoke(appManager,'startApplication',app)
    

    Thanks for your help Best regards Jean-Christophe