Friday, September 26, 2014

Script PIA and psadmin

Depending of how you are coding your script to start/stop your webserver, it might not work.

Small example:
[root@vv-cephei-b ~]# cat start_hcm92dmo_web.sh
su - hcm92 <<EOF
psadmin -w start -d peoplesoft
exit
EOF
[root@vv-cephei-b ~]# sh ./start_hcm92dmo_web.sh
Last login: Fri Sep 26 10:33:57 CEST 2014

Starting the domain [peoplesoft].
General Exception: null

java.lang.NullPointerException
        at com.peoplesoft.pt.psadmin.ui.Progress.<init>(Progress.java:135)
        at com.peoplesoft.pt.psadmin.ui.Progress.getInstance(Progress.java:123)
        at com.peoplesoft.pt.psadmin.pia.DomainBootHandler.BootWlsServer(DomainBootHandler.java:84)
        at com.peoplesoft.pt.psadmin.pia.DomainBootHandler.run(DomainBootHandler.java:62)
        at com.peoplesoft.pt.psadmin.pia.PIAAdminCmdLine.startDomain(PIAAdminCmdLine.java:270)
        at com.peoplesoft.pt.psadmin.pia.PIAAdminCmdLine.run(PIAAdminCmdLine.java:481)
        at com.peoplesoft.pt.psadmin.PSAdmin.runSwitched(PSAdmin.java:170)
        at com.peoplesoft.pt.psadmin.PSAdmin.main(PSAdmin.java:232)
[root@vv-cephei-b ~]#

It seems to be a known bug prior Peopletools 8.54:
Trying to Start or Stop WebLogic using psadmin while using Cron Results in Error - General Exception: null - java.lang.NullPointerException (Doc ID 1908227.1)
According to the note, it should be solved in Peopletools 8.54, and obviously it is not for me... even though I'm on the newest one, 8.54.03.

Now, rewording the script:
[root@vv-cephei-b ~]# cat start_hcm92dmo_web.sh
su - hcm92 -c "psadmin -w start -d peoplesoft"
[root@vv-cephei-b ~]# sh ./start_hcm92dmo_web.sh

Starting the domain [peoplesoft].......
Server state changed to STARTING.........
Server state changed to STANDBY..
Server state changed to STARTING..............
Server state changed to ADMIN..
Server state changed to RESUMING....
Server state changed to RUNNING..
Verifying domain status.
The domain has started.

[root@vv-cephei-b ~]#

Much better ! Bug solved.

Nicolas.

1 comment:

Rich Langer said...

Just as a followup, the bug report has been closed as 92 - Closed, Not a Bug
The problem is that the psadmin command requires a terminal to display the .... when starting and stopping the appserver (as far as I can tell.)
However, I prefer to have peoplesoft start upon boot instead of having to manually login and start them.
I did find a workaround for my init scripts
There is a linux command called script that emulates a terminal and redirects the output.
Fails:
nohup psadmin -w start -d peoplesoft
Succeeds:
nohup script -q -c "psadmin -w start -d peoplesoft"

The other option is to use the startPIA.sh and stopPIA.sh deployed in $PS_CFG_HOME/webserv/peoplesoft/bin/

Using Oracle Enterprise Linux 6.7

I prefer the blocking when I start/stop the webserver so I know when it is actually complete when I manually execute them.