Thursday 3 April 2014

Starting JD Edwards weblogic processes automatically–best practice

Best practice for starting weblogic processes:

Intro

You are going to use weblogic.WLST scripting. This is available in interactive or batch mode. If you are having issues, I recommend using interactive mode for debugging.

You can access the console by setting your domainEnv (as per below):

Testing

D:\Oracle\Middleware\user_projects\domains\E1_Apps\bin\setDomainEnv.cmd

I like to check my java version

java –version

Then start the command interface

java weblogic.WLST

(you can exit with exit() )

Change nodemanager username and password:

Generate some secure connection files, but remember to firstly change the default username and password for logging into the node manager:

This was very helpful:

http://oraclemiddlewareblog.com/2012/01/15/cannot-connect-to-node-manager-access-to-domain-for-user-weblogic-denied/

Make sure you log into: http://localhost:7001/console/login/LoginForm.jsp (this is the default URL)

clip_image002

Lock and edit

clip_image004

Activate changes, they should work immediately. See that I’ve set them the same as weblogic

Generate userconfigfile & userkeyfile

Then you’ll be able to issue the connect statement from weblogic.WLST

So, generate the userconfigfile and the userkeyfile – so passwords just are not hanging about!

java weblogic.Admin -adminurl t3://adminserverl:port -username <adminusername> -password <adminpassword> -userconfigfile userconfig -userkeyfile userkey –STOREUSERCONFIG

d:\Oracle\Middleware\user_projects\domains\E1_Apps>java weblogic.Admin –adminurl t3://localhost:7003 -username weblogic -password xxxx -userconfigfile user config -userkeyfile userkey –STOREUSERCONFIG

clip_image005

Copy these files to a dir of choice. I then use 2 files, a bat file and a command file to pass into weblogic.WLST

clip_image007

Create your scripts:

Note that I have my security files and also the cmd and py commands.

startJDE.bat

@rem Script to start

call D:\Oracle\Middleware\user_projects\domains\E1_Apps\bin\setDomainEnv.cmd

java weblogic.WLST D:\StartWeb\StartJDE.py > d:\startweb\StartJDE.log

@exit

StartJDE.py

print 'starting the script .... '

redirect('d:\StartWeb\WLSTLogs.txt')

startNodeManager(verbose='true',NodeManagerHome='D:/Oracle/Middleware/wlserver_10.3/common/nodemanager',ListenPort='5556', ListenAddress='' );

nmConnect(userConfigFile='d:\StartWeb\userconfigNM.secure',userKeyFile='d:\StartWeb\userkeyNM.secure',domainName='E1_Apps', port='5556', nmType='ssl')

nmStart('AdminServer');

nmStart('JWB02P_PDCMSAU_94');

nmStart('JWB02P_PDCMSNZ_95');

nmStart('JWB02P_PDFIN_96');

nmStart('JWB02P_PDFIN_97');

exit()

Then schedule the script to run as a domain account (same as server manager) in the task scheduler.  Therefore all of your processes will start as the correct user and SM will be able to communicate with them.

No comments: