Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

try/catch when creating a wlst deployment session....

655092May 19 2009 — edited May 20 2009
in the DspCommonCommands.py there is a definition similar to (sorry the spaces don't translate well here):
Line: -----
def createDeploymentSession(sessionName):
moveToDomainServiceMBean()
wlst.invoke("createDeploymentSession",[sessionName],["java.lang.String"])
moveToDeploymentSessionMBean(sessionName)
Line: -----


If my deployment script fails and someone tries to rerun it, there may be a session left out there. So, I want to do something very simple to catch the exception and do something with it.

As a start, I changed the above code to:

Line: -----
def createDeploymentSession(sessionName):
moveToDomainServiceMBean()

try:
wlst.invoke("createDeploymentSession",[sessionName],["java.lang.String"])
except :
print "DISCARDING OLD SESSION WITH THE SAME NAME..."
discardDeploymentSession(sessionName)
wlst.invoke("createDeploymentSession",[sessionName],["java.lang.String"])

moveToDeploymentSessionMBean(sessionName)
Line: -----

Now, the script discards the old session and continues on its merry way, but the output still includes the trace of the original error.

How can I "hide" the stack trace of the error and let the script continue on its way?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 17 2009
Added on May 19 2009
5 comments
3,935 views