Converting a Weblogic Server domain from Production Mode to Development Mode
There are several ways to configure the mode of the domain. One can use the Administration Console, WLST, a command-line argument, or edit the configuration files directly.
Changing Modes Using the Administration Console
Using the Administration Console is the easiest way to change from development mode to production mode or vice versa. Follow these steps:- In the left pane of the Console, under Domain Structure, select the domain name.
- Select Configuration -> General and select the Production Mode check box.
- Click Save.
- Shut down any servers that are currently running.
- Invoke the domain's startWebLogic script. The Administration Server starts in the new mode.
- If the domain contains Managed Servers, start the Managed Servers.
Using WLST to Change Modes
Here is an example of how to use WLST to change to production mode:
wls:/offline> connect('username','password')
wls:/mydomain/serverConfig> edit()
wls:/mydomain/edit> startEdit()
Starting an edit session ...
Started edit session, please be sure to save and activate your changes once you are done.
wls:/mydomain/edit !> cmo.setProductionModeEnabled(true)
wls:/mydomain/edit !> activate()
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released
once the activation is completed.
The following non-dynamic attribute(s) have been changed on MBeans
that require server re-start:
MBean Changed : com.bea:Name=AdminServer,Type=WebServerLog,Server=AdminServer,
WebServer=AdminServer
Attributes changed : RotateLogOnStartup
MBean Changed : com.bea:Name=AdminServer,Type=WebServerLog,Server=AdminServer,
WebServer=AdminServer
Attributes changed : RotateLogOnStartup
MBean Changed : com.bea:Name=Domain1,Type=Log
Attributes changed : RotateLogOnStartup
Activation completed
wls:/mydomain/edit> exit()
To change to development mode instead, simply setProductionModeEnabled to false rather than true. See the WLST documentation for more information.wls:/mydomain/serverConfig> edit()
wls:/mydomain/edit> startEdit()
Starting an edit session ...
Started edit session, please be sure to save and activate your changes once you are done.
wls:/mydomain/edit !> cmo.setProductionModeEnabled(true)
wls:/mydomain/edit !> activate()
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released
once the activation is completed.
The following non-dynamic attribute(s) have been changed on MBeans
that require server re-start:
MBean Changed : com.bea:Name=AdminServer,Type=WebServerLog,Server=AdminServer,
WebServer=AdminServer
Attributes changed : RotateLogOnStartup
MBean Changed : com.bea:Name=AdminServer,Type=WebServerLog,Server=AdminServer,
WebServer=AdminServer
Attributes changed : RotateLogOnStartup
MBean Changed : com.bea:Name=Domain1,Type=Log
Attributes changed : RotateLogOnStartup
Activation completed
wls:/mydomain/edit> exit()
Using a Command-Line Argument to Change Modes
To specify a mode from the command line, include the following argument in the startup command:
-Dweblogic.ProductionModeEnabled=true
Specify false rather than true to specify development mode.
NOTES:
- This command line argument is deprecated in Oracle Weblogic Server 10.3.0, so this option should only be used with WLS versions from WLS 9 to 10.0.2.
- If you start the administration server with the -Dweblogic.ProductionModeEnabled=false option, it will start in development mode, but the console will still reflect the value of <production-mode-enabled> in config.xml and say that it is enabled in Production Mode when in fact it is not.
Editing the Configuration Files Manually
Oracle doesn't recommend changing the configuration files manually because problems can occur if a mistake is made. However, production/development mode is configured in the config.xml file. Follow these steps:- Stop the servers running in a domain.
- Open the config.xml file location under MIDDLEWARE_HOME/domains/<domain_name>/config.
- Change the production-mode entry to false (for development mode) or true (for production mode), save the file, and exit.
- Start all servers.
NOTE: You can also set the value PRODUCTION_MODE to true or false in setDomainEnv.sh file but if you want to back out the change you need to change the config.xml file.
0 Comments