Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Jython start server script

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have successfully written a jython script to stop a server on WAS studio 5.1.2 using the following wsadmin.bat -lang jythion -f 'C:\temp\myscript.py'.

However when I try to restart the same server using another jython script I get the following exception.

Z:\bin>wsadmin.bat -lang jython -f c:\temp\jythonscripts\test1.py
Drive already SUBSTed
WASX7023E: Error creating "SOAP" connection to host "localhost"; exception infor
mation: com.ibm.websphere.management.exception.ConnectorNotAvailableException
WASX7213I: This scripting client is not connected to a server process; please re
fer to the log file C:\Program Files\IBM\WebSphere Studio\Application Developer\
v5.1.2\runtimes\base_v51\logs\wsadmin.traceout for additional information.
WASX7017E: Exception received while running file "c:\temp\jythonscripts\test1.py
"; exception information: com.ibm.ws.scripting.ScriptingException: WASX7254E: "s
tartServer" action not supported when process type is "unknown"


Here is the jython module the parameters I pass in are server1,localhost the script runs okay when I want to run the stopserver method of the AdminControl class.

Has anyone come across this problem before ?

def stopserver(serverName, nodeName):
global AdminConfig
global AdminControl
global AdminApp
servermessage = 'Server started'
AdminControl.startServer(serverName, nodeName)
return servermessage
 
author
Posts: 4112
28
Google Web Toolkit Eclipse IDE Flex
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I recall, wsadmin attempts to connect to the active server before running any commands so when the server is stopped, it has no connection to work with. I'm not sure the best way to get around this but I suggest specifying the parameters for the specific server and profile explicitly. There may be other command line arguments that prevent the script from trying to access the server directly that might work.
[ December 13, 2005: Message edited by: Scott Selikoff ]
 
Brian Hennessy
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Scott I think you've hit the nail on the head. On webSphere Studio it needs an active server process running so when I stop the server it cannot connect to the 8880 soap port to execute the commands. i tried creating another server with different SOAP ports but that also starts up as server1 open for e-business not sure why this is possibly all servers created run under this process id server1???.

For what I intened the script to do will have to be tested on a WebSphere Application Server network deployment installation and run the wsadmin cmd from the deployment manager.

Thanks again for the quick response
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!