Load libraries to a WLST script.

(Doc ID 1225456.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Weblogic Server - Version 9.2 and later
Information in this document applies to any platform.

Symptoms

When attempting to run a Weblogic Scripting Tool Script
the following error occurs.


File "<SCRIPT_LOCATION>/WLSTScript.py", line X, in ?
AttributeError: java package 'weblogic.time' has no attribute 'sleep'



In order to reproduce this issue, the following steps are required:

1. Create the following code snippet.


import time

print 'Connecting to Server'
connect('weblogic', 'welcome1', 't3://localhost:7001')
print 'Sleeping for 3 seconds'
time.sleep(3)
print 'Sleeping for 2 seconds'
time.sleep(2)
print 'Sleeping for 1 second'
time.sleep(1)
print 'Bye'



2. Go to the following path:<WLS_HOME>/weblogic922/common/bin/wlst.sh <PATH_OF_SCRIPT/wlstScript.py> for excecuting the script.

Expected behaviour.

Problem invoking WLST - Traceback (innermost last):
File "<SCRIPT_LOCATION>/TimeSleep2.py", line 6, in ?
AttributeError: java package 'weblogic.time' has no attribute 'sleep'


Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms