Starting WebLogic Server
WebLogic in Zip distribution
Oracle WebLogic zip distribution is made easy for developers and architects to test their experiments on the server made simple. You can install and run the WebLogic domain within a short span of time.
1. Download from the Oracle Technical networks
2. Now goto your home directory create a directory (wls12c)
3. Define the environment variables
4. Run the command configure.sh or configure.cmd this will extract the weblogic server related jars and libraries and binaries make you available.
5. The command line invocation of weblogic.Server have the internal capbility to configure domain so create a domain folder and run java weblogic.Server with proper PermSize that suites to your environment. That will check for config.xml and says not found creating new one. asks you username, password for the new domain. You will get default domain configured with this. Stop the RUNNING server by Ctrl + C.
6. Use the standard startWebLogic.sh or cmd to start the admin server of that just created domain.
7. open a new browser and access the http://localhost:7001/console you will find the fully loaded WebLogic Server available for your experiments.
starting server in ADMIN mode
While restarting the WebLogic servers, if you see any managed server going into “Admin” state instead of “Running” state, You need to investigate that managed server logs and try to find out what is causing it. Admin – state indicates that there are some system resources or components are not loading properly into the JVM memory during the startup of the managed server because of some issue respect to the component.
For example Database might be down and you are starting the Managed server, in the startup it will look for establish the connection to the database when it is failed the server state will be declared as "ADMIN" mode.
So, if you see any server showing in “ADMIN” state please do not simply “Resume” the server to come into “Running” state. Please find out the origin of issue causing and fix it or work with respective team to fix the issue.
To understand more about starting WebLgoic server. Following are the experiment with respect to WebLogic server starting with simple java class invoke command.
Using weblogic.Server Class
Usage: java [options] weblogic.Server [args...]
Where WebLogic options include:
-Djava.security.policy=<value> the location of the security policy
file
-Dweblogic.Domain=<value> WebLogic domain name
-Dweblogic.Name=<value> WebLogic server name
-Dweblogic.ext.dirs=<value>
':' separated list of directories to pick up jars from
and add to the end of the server classpath.
The list can also contain individual jars.
-Dweblogic.management.server=<value>
WebLogic Admin Server URL for starting
a Managed Server, the value can be:
host:port or
-Dweblogic.home=<value>
The location of the WebLogic Server
product install. By default, this will
be derived from the classpath.
-Dweblogic.RootDirectory=<value>
The root directory of your domain,
where your configuration is housed.
default is the current working
directory
-Dweblogic.management.username=<value>
user name
-Dweblogic.management.password=<value>
user password
-Dweblogic.management.pkpassword=<value>
private key password
-Dweblogic.security.unixrealm.authProgram=<value>
the name of the program used to
authenticate users in the unix
security realm
-Dweblogic.<ServerAttributeName>=<value>
specify a server attribute, it will
override the attribute value set in
config.xml for this server
-Dweblogic.admin.host=<value> same as weblogic.management.server, an
old property
-javaagent:$WL_HOME/server/lib/diagnostics-agent.jar
enable diagnostics hot code-swap for application classes
And WebLogic args include:
-? -help print this help message
Using the weblogic.Server Command Line to Start admin Server
1) To Start a admin Server we need to go to domains directory and use the following command:
java weblogic.Server
The JVM parameters will be considered default as 256 MB minimum and 512MB maximum heap size to change we can specify as follows:
java -Xms512m -Xmx1024m -XX:MaxPermSize=512m weblogic.Server
while starting the admin server by using the weblogic.Server command Line references, uses minmum capability to start the Server instances. When we open the WebLogic Console in a browser it requires the load the console portal which cannot run on the default heap size like -Xms512m -Xmx1024m , need to increase the heap size and Permanent Size for the JVM also need to increase with -XX:MaxPermSize=512m. following command also works for running Admin server.
java -XX:MaxPermSize=512m weblogic.Server
If we don't use the JVM parameter of XX:MaxPermSize=512m , we will face the issue of "Out of Memor Error(perm gen error)" when accessing the console of admin
2) To Start the managed server by weblogic.Server command
Syntax :
java -Dweblogic.Name=managed-server-name -Dweblogic.management.server=adminURL weblogic.Server
java -Dweblogic.Name=app02 -Dweblogic.management.server=http://WLHOST:7913 -Dweblogic.management.username='weblogic' -Dweblogic.management.password='weblogic' weblogic.Server
ADMIN Mode starting a Managed Server
To run the command line for the managed server for our regular example: (Here WLHost replace with your own)
nohup java -Dweblogic.Name=app02 -Dweblogic.management.server=http://WLHOST:7913 -Dweblogic.management.username='weblogic' -Dweblogic.management.password='weblogic' -Dweblogic.management.startupMode=ADMIN weblogic.Server >app02.out 2>&1 &
To check the status of the Server into the logs are as follows:
tail -100f app02.out
STANDBY Mode starting a Managed Server
To run the command line for the managed server for our regular example: (Here WLHost replace with your own)
nohup java -Dweblogic.Name=app02 -Dweblogic.management.server=http://WLHOST:7913 -Dweblogic.management.username='weblogic' -Dweblogic.management.password='weblogic' -Dweblogic.management.startupMode=STANDBY weblogic.Server >app02.out 2>&1 &
To check the status of the Server into the logs are as follows:
tail -100f app02.out