My Oracle Support Banner

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

Last updated on FEBRUARY 04, 2019

Applies to:

Oracle WebLogic Server - Version 10.3 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://<IP ADDRESS>:<PORT>')
   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://<IP ADDRESS>:<PORT> 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

To view full details, sign in with your My Oracle Support account.

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


In this Document
Goal
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.