When running a wsadmin Jython command (from a Jython script file), I get the following error
WASX7023E: Error creating "SOAP" connection to host "localhost"; exception information: com.ibm.websphere.management.exception.ConnectorNotAvailableException: [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to find a valid IP for host localhost] WASX7213I: This scripting client is not connected to a server process; please refer to the log file /opt/IBM/WebSphere/AppServer/profiles/DV_AppServer01Prof/logs/wsadmin.traceout for additional information. WASX8011W: AdminTask object is not available. INFO:Global security is enabled WASX7017E: Exception received while running file "/var/apps/scripts/wasAdmin/security/configureGlobalSecurity.py"; exception information: com.ibm.bsf.BSFException: exception from Jython: Traceback (innermost last): File "<string>", line 85, in ? File "<string>", line 62, in getDefaultRealm NameError: AdminTask
As we can see by the error in the stack trace, the AdminTask object is not available, this is because the WebSphere Application Server/Deployment Manager is not started.