How to Disable the Exception Stack Trace in a WebLogic Scripting Tool (WLST) Python Script (Doc ID 1316108.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Weblogic Server - Version: 10.3 and later   [Release: and later ]
Information in this document applies to any platform.

Goal

This document describes how to disable an exception stack trace from writing out to the screen from a WebLogic Scripting Tool (WLST) Python script file. A small demonstration is provided to show how the parameter works.

A Python script file, with try/catch code implemented, will display a stack trace to the screen when the script is executed with WLST.

Here is an example. The abc.py script file is using an invalid password:

try:
  connect('weblogic','invalid_password','t3://localhost:7001')
   print "Successfully connected"
except:
  print "Error while trying to connect!!!"
exit()

Execute the script file as follows, and observe the output shown:

/WLS/bea1030/wlserver_10.3/common/bin>wlst.sh abc.py
Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Connecting to t3://localhost:7001 with userid weblogic ...
This Exception occurred at Fri Apr 22 05:34:13 IST 2011.
javax.naming.AuthenticationException [Root exception is java.lang.SecurityExcept
ion: User: weblogic, failed to be authenticated.]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(Exceptio
nTranslator.java:42)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLIni
tialContextFactoryDelegate.java:783)
at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialCo
ntextFactoryDelegate.java:677)
.
.
.
.
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:473)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.jav
a:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Error while trying to connect!!!

Exiting WebLogic Scripting Tool.

Solution

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