Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

need a jython script

108 views
Skip to first unread message

rodney...@asg.aon.com

unread,
May 21, 2008, 3:23:10 PM5/21/08
to
I'm new to jython and need a script that will recursively run through all the app server instances on a node and change the min and max heap size to values that I pass to the script. Does anyone have one handy or could put one together quickly?

thanks

Also,does anyone have any recommendations on favorite resources for learning WebSphere 6.1 jython

Thanks

Ben_

unread,
May 21, 2008, 3:33:04 PM5/21/08
to

rodney...@asg.aon.com

unread,
May 21, 2008, 4:02:59 PM5/21/08
to
thanks Ben, but the link you posted does not exist. The page is not found in the infocenter doc.

Ben_

unread,
May 21, 2008, 4:21:56 PM5/21/08
to
My post was correct, it's this ***** forum which is broken.

Remove the %20 sign it added and you get the page.

Infyniti

unread,
May 21, 2008, 4:45:16 PM5/21/08
to
remove the %20 from the url, it should work.

Here is an example, just change the intial and max heap size of your choice.

lineSeparator = java.lang.System.getProperty( 'line.separator' )
st = AdminTask.listServers( '[-serverType APPLICATION_SERVER]' ).split(lineSeparator)
for aServer in st:
print 'aServer is :' ,aServer
sName = AdminConfig.showAttribute(aServer, "name" )
sID = AdminConfig.getid( "/Server:" +sName+ "/" )
pDef = AdminConfig.list( "ProcessDef" , sID)
jvm = AdminConfig.list( "JavaVirtualMachine" , pDef)
AdminConfig.modify(jvm, [[ "initialHeapSize" , 256]] )
AdminConfig.modify(jvm, [[ "maximumHeapSize" , 512]] )
AdminConfig.save()


Anant

rodney...@asg.aon.com

unread,
May 21, 2008, 5:04:26 PM5/21/08
to
Help.help() displays the following info:

attributes given an MBean, returns help for attributes

operations given an MBean, returns help for operations

constructors given an MBean, returns help for constructors

description given an MBean, returns help for description

notifications given an MBean, returns help for notifications

classname given an MBean, returns help for classname

all given an MBean, returns help for all the above

help returns this help text

AdminControl returns general help text for the AdminControl object

AdminConfig returns general help text for the AdminConfig object

AdminApp returns general help text for the AdminApp object

wsadmin returns general help text for the wsadmin script

launcher

message given a message id, returns explanation and

user action message

How do you invoke AdminTask

Infyniti

unread,
May 21, 2008, 8:58:51 PM5/21/08
to
AdminTask is a new object added in Version 6.

http://www.ibm.com/developerworks/websphere/techjournal/0509_wang/0509_ wang.html

rodney...@asg.aon.com

unread,
May 22, 2008, 8:12:56 AM5/22/08
to
print AdminTask.listServers()

WASX7015E: Exception running command: "print AdminTask.listServers()"; exception information:

com.ibm.bsf.BSFException: exception from Jython: Traceback (innermost last):

File " print AdminTask.help()

WASX7015E: Exception running command: "print AdminTask.help()"; exception information:

com.ibm.bsf.BSFException: exception from Jython: Traceback (innermost last):

File "", line 1, in ?

NameError: AdminTask

any ideas

Anant

unread,
May 22, 2008, 6:19:19 PM5/22/08
to
Not sure why it does not work for you. I tried on both 6.0.2.23 and 6.1 it works for me.

This has nothing to do with the error, are you invoking the wsadmin with the following parameters to run the jython commands.

wsadmin.sh -lang jython

0 new messages