Important Files

It is important to know which files are meant to perform what functions so that you can successfully administer your WebLogic Server. The following sections cover the important files.

config.xml

The WebLogic Server's configuration settings are stored in the config.xml file. This XML is validated with the rules defined in the config.dtd file when the server boots up. The config.xml file that was configured for your domain through the configuration wizard exists in the path BEA_HOME\user_domain\mydomain, while that for the examples server exists in the path USER_INSTALL_DIR\samples\server\config\examples. It is a good exercise to open the examples server's config.xml file and familiarize yourself with each of its elements.

The config.xml files contains a record of

  • Domain details, including the name of the domain, the administration port, and so on

  • Security configuration

  • JTA elements

  • JDBC pool configuration and DataSource configurations, with the JNDI names for each of them

Editing the config.xml file can be done in the following ways:

  • By using the Administration Console.

  • By opening the file in any editor.

  • From other programs through the WebLogic Server application programming interface (API).

  • Through command-line utilities.

  • With the BEA XML editor. This editor can also validate the XML file against the config.dtd file.

  • With the WebLogic Builder tool, as described earlier.

The BEA XML editor is a good choice because it validates the config.xml file. None of the other utilities validate the config.xml file. Any errors in the config.xml file result in the server's failure to boot without any warning.

While you edit the config.xml file, keep these points in mind:

  • You should shut down the domain server before editing the config.xml file. Every time the server shuts down, the config.xml file is saved again or updated on the local drive. This results in the overwriting of any manually edited config.xml files done while the server was running.

  • It is a safe practice to make a backup of the XML file before you edit it.

  • Changing the names of any services or resources can be hazardous.

startWebLogic.cmd or .sh

This file is needed to boot the domain server. A typical startWebLogic.cmd or .sh file contains the following information:

  • SERVER_NAME The name of the administrative server for the domain (in the example in this appendix, local).

  • WLS_USER The user ID to log on to this domain server.

  • WLS_PW The password for this domain server. The values of user ID and password can be entered here. If they are entered, the WebLogic Server will not prompt you for these values on startup. However, this is not a very safe practice in a production environment; it is suitable in a development environment only.

  • STARTMODE This setting signifies whether the server is to be started in production mode or server mode. True signifies production mode, while false signifies development mode.

  • JAVA_VM The Java virtual machine used for executing the WebLogic Application Server is named here.

  • MEM_ARGS This parameter denotes the stack and heap sizes for the WebLogic Application Server executable file. This file finally calls a common startWLS.cmd file, which is located in the USER_INSTALL_DIR\server\bin directory. Listing B.2 shows the contents of the startWLS.cmd file.

Listing B.2 startWLS.cmd
 @rem ************************************************************************* @rem This script is used to start WebLogic Server @rem @rem To create your own start script for your domain, simply set the @rem SERVER_NAME variable to your server name then call this script from your @rem domain directory. @rem @rem This script sets the following variables before starting WebLogic Server: @rem @rem WL_HOME    - The root directory of your WebLogic installation @rem JAVA_HOME  - Location of the version of Java used to start WebLogic @rem              Server. This variable must point to the root directory of a @rem              JDK installation and will be set for you by the installer. @rem              See the WebLogic platform support page @rem              (http://e-docs.bea.com/wls/platforms/index.html) @rem              for an up-to-date list of supported JVMs on Windows NT. @rem PATH       - Adds the JDK and WebLogic directories to the system path. @rem CLASSPATH  - Adds the JDK and WebLogic jars to the classpath. @rem @rem Other variables that startWLS takes are: @rem @rem WLS_USER       - admin username for server startup @rem WLS_PW         - cleartext password for server startup @rem ADMIN_URL      - if this variable is set, the server started will be a @rem                  managed server, and will look to the url specified (i.e. @rem                  http://localhost:7001) as the admin server. @rem STARTMODE      - set to true for production mode servers, false for @rem                  development mode @rem JAVA_OPTIONS   - Java command-line options for running the server. (These @rem                  will be tagged on to the end of the JAVA_VM and MEM_ARGS) @rem JAVA_VM        - The java arg specifying the VM to run.  (i.e. -server, @rem                  -client, etc.) @rem MEM_ARGS       - The variable to override the standard memory arguments @rem                  passed to java @rem PRE_CLASSPATH  - Path style variable to be added to the beginning of the @rem                  CLASSPATH @rem POST_CLASSPATH - Path style variable to be added to the end of the @rem                  CLASSPATH @rem PRE_PATH       - Path style variable to be added to the beginning of the @rem                  PATH @rem POST_PATH      - Path style variable to be added to the end of the PATH @rem @rem Alternately, this script will take the first two positional parameters @rem and set them to SERVER_NAME and ADMIN_URL.  For instance, you could call @rem this script: "startWLS.cmd myserver http://localhost:7001" to @rem start a managed server named myserver, or just "startWLS.cmd @rem myserver" to start a server named myserver. @rem @rem jDriver for Oracle users: This script assumes that native libraries @rem required for jDriver for Oracle have been installed in the proper @rem location and that your system PATH variable has been set appropriately. @rem @rem For additional information, refer to the WebLogic Server Administration @rem Guide (http://e-docs.bea.com/wls/docs70/adminguide/startstop.html). @rem ************************************************************************* @echo off SETLOCAL set WL_HOME=C:\bea\weblogic700 set JAVA_HOME=C:\bea\jdk131_02 @rem Check that the WebLogic classes are where we expect them to be :checkWLS if exist "%WL_HOME%\server\lib\weblogic.jar" goto checkJava echo The WebLogic Server wasn't found in directory %WL_HOME%\server. echo Please edit your script so that the WL_HOME variable points echo to the WebLogic installation directory. goto finish @rem Check that java is where we expect it to be :checkJava if exist "%JAVA_HOME%\bin\java.exe" goto runWebLogic echo The JDK wasn't found in directory %JAVA_HOME%. echo Please edit your script so that the JAVA_HOME variable echo points to the location of your JDK. goto finish :runWebLogic if not "%JAVA_VM%" == "" goto noResetJavaVM set JAVA_VM=-hotspot :noResetJavaVM if not "%MEM_ARGS%" == "" goto noResetMemArgs set MEM_ARGS=-Xms32m -Xmx200m :noResetMemArgs @rem Set first two positional parameters to SERVER_NAME and ADMIN_URL if not "%1" == "" if "%SERVER_NAME%" == "" set SERVER_NAME=%1 if not "%2" == "" if "%ADMIN_URL%" == "" set ADMIN_URL=%2 set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\weblogic_sp.jar;         %WL_HOME%\server\lib\weblogic.jar;%CLASSPATH% set PATH=.;%WL_HOME%\server\bin;%JAVA_HOME%\bin;%PATH% @rem Import extended environment if exist extEnv.cmd call extEnv.cmd if not "%EXT_PRE_CLASSPATH%" == "" set CLASSPATH=%EXT_PRE_CLASSPATH%;%CLASSPATH% if not "%EXT_POST_CLASSPATH%" == "" set CLASSPATH=%CLASSPATH%;         %EXT_POST_CLASSPATH% if not "%EXT_PRE_PATH%" == "" set PATH=%EXT_PRE_PATH%;%PATH% if not "%EXT_POST_PATH%" == "" set PATH=%PATH%;%EXT_POST_PATH% @rem Get PRE and POST environment if not "%PRE_CLASSPATH%" == "" set CLASSPATH=%PRE_CLASSPATH%;%CLASSPATH% if not "%POST_CLASSPATH%" == "" set CLASSPATH=%CLASSPATH%;%POST_CLASSPATH% if not "%PRE_PATH%" == "" set PATH=%PRE_PATH%;%PATH% if not "%POST_PATH%" == "" set PATH=%PATH%;%POST_PATH% @echo. @echo CLASSPATH=%CLASSPATH% @echo. @echo PATH=%PATH% @echo. @echo *************************************************** @echo *  To start WebLogic Server, use a username and   * @echo *  password assigned to an admin-level user.  For * @echo *  server administration, use the WebLogic Server * @echo *  console at http://[hostname]:[port]/console    * @echo *************************************************** @rem Start Server @echo off if "%ADMIN_URL%" == "" goto runAdmin @echo on "%JAVA_HOME%\bin\java" %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath         "%CLASSPATH%" -Dweblogic.Name=%SERVER_NAME% -Dbea.home="C:\bea"          Dweblogic.management.username=%WLS_USER% -Dweblogic.management.password         =%WLS_PW% -Dweblogic.management.server=%ADMIN_URL%         -Dweblogic.ProductionModeEnabled=%STARTMODE% - Djava.security.policy ="%WL_HOME%\server\lib\weblogic.policy" weblogic.Server goto finish :runAdmin @echo on "%JAVA_HOME%\bin\java" %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath         "%CLASSPATH%" -Dweblogic.Name=%SERVER_NAME% -Dbea.home="C:\bea" -         Dweblogic.management.username=%WLS_USER% -Dweblogic.management.password=         %WLS_PW% -Dweblogic.ProductionModeEnabled=%STARTMODE% -         Djava.security.policy="%WL_HOME%\server\lib\weblogic.policy"         weblogic.Server :finish ENDLOCAL 

Note

Before you run the script to start the server, you have to set the CLASSPATH parameter and put all the required classes into your classpath. For example, the database drivers' CLASSPATHs need to be added to the CLASSPATH if you create connection pools for a specific database. It would be worth the effort to add these CLASSPATH setting statements into the startWLS.cmd file or the startWebLogic.cmd file once you have determined your need for these settings to run your WebLogic Server.


setEnv.cmd or .sh

To run any software, an environment has to be set up. This environment sets various CLASSPATHs and PATHs that point to the directories required.

The setEnv file is called by the startWebLogic command before it performs any further tasks. This setEnv in turn calls the file setWLSEnv.cmd or setWLSEnv.sh. This file in turn sets the JAVA_HOME, WL_HOME, PATH, and CLASSPATH variables for JDK and WebLogic home directories, after checking whether the JDK directory exists. These values are filled in during installation with the user inputs.



Sams Teach Yourself BEA WebLogic Server 7. 0 in 21 Days
Sams Teach Yourself BEA WebLogic Server 7.0 in 21 Days
ISBN: 0672324334
EAN: 2147483647
Year: 2002
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net