I am running a Jython script from wsadmin
. This is the portion where its throwing an error.
SCRIPT:
..
..
objNameString = AdminControl.completeObjectName('WebSphere:type=Server,*')
NODE_NAME=AdminControl.getAttribute(objNameString, 'nodeName')
CELL_NAME=AdminControl.getCell()
SERVER_NAME= "MyAppServer"
..
..
# Start Web application
print "Starting Web Application..."
appManager = AdminControl.queryNames('cell='+ CELL_NAME +',node='+ NODE_NAME +',type=ApplicationManager,process='+ SERVER_NAME +',*')
print appManager
AdminControl.invoke(appManager, 'startApplication', 'AppName')
print "Web Application Started..."
ERROR:
Starting Web Application...
WASX7017E: Exception received while running file "/scratch/py/CreateWPSDomain.py"; exception information: com.ibm.ws.scripting.ScriptingException: WASX7025E: Error found in String ""; cannot create ObjectName.
Anything wrong with the way I have concatenated ? Coz the error like this seems to come when values are empty or not registered properly.
Update: Is there any sample jython scripts which I can reference. My req: 1. Creates a server > 2. Install the war file > 3. Creates Datasources > 4. Starts the Server > 5. Starts the Application.
Please make sure that your server is started, I think when you are calling the command... the Server is not started yet. Give a delay or keep a check whether the server is up ...then issue the command