How to find WebsphereVersion(Exact build number) in python/jython scripts ?
The following lines of code will give the exact WAS version along with build number when used in a jython or python script.
wsadminNode = AdminControl.getNode()
print wsadminNode
wsadminSvr = AdminControl.queryNames("node="+wsadminNode+",type=Server,*")
print wsadminSvr
#wsadminVers = AdminControl.getAttribute(wsadminSvr, "platformVersion")
# The above line also gives us the WAS version but it will not give the exact build number details.
wsadminSvrON = AdminControl.makeObjectName(wsadminSvr)
wsadminVers = wsadminSvrON.getKeyProperty('version')
print wsadminSvr
Hope this helps in finding the WAS versions in a jython/python script.
The above when run with wsadmin.sh script some times it throws the following error.
AppSrv01\bin>wsadmin.bat -conntype NONE -javaoption -Xmx384m -f C:/kb/1321CDSUpdateAPP.py -lang jython -appServerName CDSServer -logDir C:/kb -logFile test.log -appFileName "C:\\kb\\test.txt" -appName CDS -controlFile c:/kb/test.txt
2010-02-25 02:41:40 CDSUpdateAPP.py main ERROR ('Update of application failed:',, com.ibm.ws.scripting.ScriptingException: AdminControl service not available)
The above error can be rectified by passing the hostname explicitly or else by changing the connection type to RMI and RMI port. When we run the above lines of code using connType none as below
./wsadmin.sh -conntype NONE -javaoption -Xmx384m -f /opt/builds/1321CDSUpdateAPP.py -lang jython -appServerName CDSServer -logDir /opt/builds -logFile test.log -appFileName /opt/builds/test.txt -appName CDS -controlFile /opt/IBM/WebSphere/AppServer/bin/testctrl.txt
It may through the error above we have seen
Solution for this will be
-host with complete hostname or ipaddr is the alternate solution, since its a failure with Java
probably we can try InetAddress.getAllByName(host) in a standalone Java program and try to resolve it the same solution will apply to wsadmin as well.
Using Connection type RMI
./wsadmin.sh -conntype RMI -port 2809 -lang jython -javaoption -Xmx384m -f /opt/builds/1321CDSUpdateAPP.py -appServerName CDSServer -logDir /opt/builds -logFile test.log -appFileName /opt/builds/test.txt -appName CDS -controlFile /opt/IBM/WebSphere/AppServer/bin/testctrl.txt
Using Host name and removing connection type NONE
./wsadmin.sh -host nc145002.tivlab.austin.ibm.com -lang jython -javaoption -Xmx384m -f /opt/builds/1321CDSUpdateAPP.py -appServerName CDSServer -logDir /opt/builds -logFile test.log -appFileName /opt/builds/test.txt -appName CDS -controlFile /opt/IBM/WebSphere/AppServer/bin/testctrl.txt
P.S: To find the different connection types and ports used by the Websphere installation, try open the Administration console using the url http://
1 comments to "How to find Websphere Version in python/jython scripts WAS"
Post a Comment
Whoever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs, u can at least use Name/URL option which doesn’t even require any sign-in, The good thing is that it can accept your lovely nick name also and the URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")
Popular Posts
-
The best solution to know about these init levels is to understand the " man init " command output on Unix. There are basically 8...
-
How to Unlock BSNL 3G data card to use it with Airtel and Vodafone Model no : LW272 ? How to unlock BSNL 3G data card( Model no : LW272 )us...
-
How to transfer bike registration from one State to other (Karnataka to Andhra)?? Most of us having two wheelers purchased and registered in...
-
ఓం శ్రీ స్వామియే శరణం ఆయ్యప్ప!! Related posts : Trip to Sabarimala - Part 1 Trip to Sabarimala - Part 2 Ayappa Deeksha required things...
-
Following are some of interesting blogs I found till now ...please comment to add your blog here. Blogs in English : http://nitawriter.word...
Popular posts
- Airtel and vodafone GPRS settings for pocket PC phones
- Andhra 2 America
- Ayyappa Deeksha required things
- Blogs I watch !
- Captions for your bike
- DB2 FAQs
- Deepavali Vs The Goddes of sleep
- ETV - Dhee D2 D3
- Evolution of smoking in India Women
- How to make credit card payments?
- init 0, init 1, init 2 ..
- Java-J2EE interview preparation
- mCheck Application jar or jad download
- My SQL FAQs
- My Travelogues
- Old is blod - New is italic
- Online pay methids for credit cards
- Oracle FAQs
- Pilgrimages
- Smoking in Indian Women
- Technology Vs Humans
- Twitter feeds for all Telugu stars on single page.
- Unix best practices
- Unix FAQs
Buffs ...
Tags
Powered by WidgetsForFree
Archives
-
▼
2010
(35)
-
▼
March
(7)
- Automatically start Websphere after system reboot ...
- String comparision in Jython script class exceptio...
- WSVR0009E: Error occurred during startup Cannot ge...
- print the time,date and time zone in java program ...
- How to find Websphere Version in python/jython scr...
- Big Banyan Tree,Srirangapatnam,Balmuri-Edmuri Fall...
- Modelart R/C Helicopter-For indoor flight-3Channel...
-
▼
March
(7)
Anonymous says:
Thanks! Exactly what I needed.
- Carl