From: conroyj <weblogic@...>
To: wlshell@yahoogroups.com
Sent: Friday, January 5, 2007 2:43:02 PM
Subject: [wlshell] Re: Problem detecting connection failure in script file
Hi Paco/Dylan/Arnaud
I notice that several people have experienced this problem but that
nobody has ever posted a solution (I have now looked through all 625
messages here!).
Has anyone worked out a resolution?
The only one I have been able to come up with was to ping the
instance prior to running my script using
java weblogic.Admin -url t3://IP:PORT -username user -password pwd
ping IP
and then not runing the script if the "Failed to connect" message
came back.
This approach, unfortunately, has some obvious flaws.
There must be a better way, even if it's just an "exit wlshell on
script failure".
Thanks
John
--- In wlshell@yahoogroups .com, "d_j_l_2006" <dylan_lobo@ ...> wrote:
>
> Hello,
>
> I'm unable to detect failure to the "connect" command from within a
> script file. I've pasted both the code and the output when calling
> the script with 1) A non existent server 2) wrong credentials
> Notice that the if command is not reached when connect fails.
> Thanks in advance.
>
> Dylan
>
> # =-=-=-=-=-=- =-=-=-=-= -=-=-=-=- =-=-=-=-= -=-=-=-=- =-=-=-=-= -=-=-=-=-
> =-=-=-=-=-=- =-=-=-=-= -=-
> #
> # File name : connect.wlsh
> #
> # Author : Dylan Lobo
> #
> # Description : This file is a wlshell script that
> establishes
> # a connection to the Weblogic server
> # =-=-=-=-=-=- =-=-=-=-= -=-=-=-=- =-=-=-=-= -=-=-=-=- =-=-=-=-= -=-=-=-=-
> =-=-=-=-=-=- =-=-=-=-= -=-
> if ($server == null) or ($user == null) or ($password == null) then
> echo "Usage: java wlshell.Main [-f scriptfile] -v
> server=WLS_URL -v user=USERNAME -v password=PASSWORD"
> exit 1
> end
>
> ############
######### ######
> #Connect to the server
> ############ ######### ######
> connect $server $user $password
> if $CONNECTED == false then
> echo "Unable to connect to the server ... exiting"
> exit 2
> end
>
>
>
>
>
>
> myserver01$ wlsh.sh -f connect.wlsh -v server=non_existant -v
> user=sample -v password=sample
> wlshell, a shell for BEA WebLogic Server. Version 2.0.2
> by Paco Gomez (c) 2002 - 2004. www.wlshell. com
> type "help" for a list of commands
> wlsh [not connected]> if ($server == null) or ($user == null) or
> ($password == null) then wlsh [not connected]> connect $server
> $user $password connecting to t3://non_existant as sample...failed
> couldn't execute all the script, there was an error at line 1:
error
> while reading script file at line 22:
> javax.naming.
ServiceUnavailab leException [Root exception is
> java.net.UnknownHos tException: non_existant] type "help" for a list
> of commands
>
> wlsh [not connected]>
>
> Wrong credentials
>
> myserver$ wlsh.sh -f connect.wlsh -v server=myserver: 61000 -v
> user=sample -v password=sample
> wlshell, a shell for BEA WebLogic Server. Version 2.0.2
> by Paco Gomez (c) 2002 - 2004. www.wlshell. com
> type "help" for a list of commands
> wlsh [not connected]> if ($server == null) or ($user == null) or
> ($password == null) then wlsh [not connected]> connect $server
> $user $password connecting to t3://myserver: 61000 as
sample...failed
> couldn't execute all the script, there was an error at line 1:
error
> while reading script file at line 22:
> javax.naming. AuthenticationEx ception [Root exception is
> java.lang.SecurityE
xception: User: sample, failed to be
> authenticated. Start server side stack trace:
> java.lang.SecurityE xception: User: sample, failed to be
> authenticated.
> at weblogic.common. internal. RMIBootServiceIm pl.authenticate
> (RMIBootServiceImpl .java:92)
> at weblogic.common. internal. RMIBootServiceIm pl_WLSkel. invoke
> (Unknown Source)
> at weblogic.rmi. internal. BasicServerRef. invoke
> (BasicServerRef. java:441)
> at weblogic.rmi. internal. BasicServerRef$ 1.run
> (BasicServerRef. java:382)
> at weblogic.security. service.Security ServiceManager. runAs
> (SecurityServiceMan ager.java: 726)
> at weblogic.rmi. internal. BasicServerRef. handleRequest
> (BasicServerRef. java:377)
> at weblogic.rmi. internal. BasicExecuteRequ est.execute
> (BasicExecuteReques t.java:30)
> at weblogic.kernel. ExecuteThread. execute
> (ExecuteThread. java:234)
> at
weblogic.kernel. ExecuteThread. run(ExecuteThrea d.java:210)
> End server side stack trace
> ]
> type "help" for a list of commands
>
> wlsh [not connected]>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com