To stop the WebLogic domain with WebLogic Scripting:
- Create a text file in the p6home/scripts directory called stop_primavera.py.
- Open stop_primavera.py using a text editor and enter the following lines:
Note: You must indent the commands under "try" and "except".
print('PRM-Stopping Primavera administration server, managed servers, and deployments')print('PRM-This will NOT attempt to stop the node manager as it may be')print('PRM-needed for other servers on this machine.')connect(userConfigFile= 'p6home/scripts/primaveraConfig.secure',userKeyFile='p6home/scripts/primaveraKeyfile.secure',url='t3://Adminserverhost:Adminserverport')try:print('PRM-Shutting down managed servermyManagedServer')shutdown('myManagedServer','Server','true',100,'true')except:print('PRM-Failed to stop managed servermyManagedServer')try:print('PRM-Shutting downAdminServer')shutdown('AdminServer','Server','true',100,'true')except:print('PRM-Failed to stopAdminServer')print('PRM-Shutdown Complete')exit()where:
- p6home is the home directory for one of the P6 EPPM applications. For example: C:\p6home
- Adminserverhost is the hostname where the administration server is running
- Adminserverport is the port number of the administration server (default is 7001)
- myManagedServer is the Logical Name of the managed server
- AdminServer is the Logical Name of the administration server
- If multiple managed servers exist, repeat the following lines from above with the name of each managed server:
Note: You must indent the commands under "try" and "except".
try:print('PRM-Shutting down managed servermyManagedServer')shutdown('myManagedServer','Server','true',100,'true')except:print('PRM-Failed to stop managed servermyManagedServer') - Save and close the file.
- Browse to
<P6_EPPM_Home>\scriptsand then create a text file called stop_primavera.bat. - Edit stop_primavera.bat and then add the following lines:
SETLOCALSET CLASSPATH=call weblogic_home\user_projects\domains\your_domain\bin\setDomainEnv.cmdcall java_home\bin\java.exe weblogic.WLST p6home\scripts\stop_primavera.pywhere:
- weblogic_home is the WebLogic Server home directory. The default is C:\Oracle\Middleware
- your_domain is the domain name directory in your environment
- java_home is the path to the JDK installed and being used by WebLogic
- p6home is the home directory for the P6 EPPM folder containing the scripts directory. For example: C:\p6home
Note: If the "java_home", "p6home" or "weblogic_home" directories contain a space in the path, it should include quotations around the full path and executable/command file being called. For example: call "C:\Program Files\Java\jdk1.6.0_27\bin\java.exe" weblogic.WLST C:\P6WebAccess\scripts\start_primavera.py
- Save and close the file.