Avoid trouble: Not all of the
WebSphere® Application Server component classes
are packaged in the same
.jar file. If you are
going to be using the wsadmin tool to run Jython scripts, include
the jython.package.path system property on your wsadmin command to
ensure that all of the required JAR files are set to the jython package
path during wsadmin startup.
./wsadmin.sh -lang jython -javaoption
"-Djython.package.path=/usr/WebSphere70/AppServer/plugins/com.ibm.ws.wlm.jar"
If
you want to invoke WebSphere Application Server functions
from different WebSphere Application Server classes
that are packaged in .jar files other than runtime.jar and admin.jar,
you can include multiple jar files in the path specified for the jython.package.path
system property, and separate them with a semicolon (;).
./wsadmin.sh -lang jython -javaoption
"-Djython.package.path=/usr/WebSphere70/AppServer/plugins/com.ibm.ws.wlm.jar;com.ibm.ws.wccm.jar"
If
you want to invoke WebSphere Application Server functions
in a jython script using ws_ant, you can create a .prop text
file, and include the following line in this file:
jython.package.path=/usr/WebSphere70/AppServer/plugins/com.ibm.ws.wlm.jar
Then
include the property file in the ant script xml file. For example:
<taskdef name="wsadmin" classname="com.ibm.websphere.ant.tasks.WsAdmin"/>
<target name="main" >
<wsadmin conntype="NONE" lang="jython" failonerror="true" properties="/tmp/jython.prop"
script="/home/fsgapp/MSTWasBuild/project/scripts/socr/socr/jython/configure.py">
</wsadmin>
</target>
gotcha