WebLogic 9.1.x configuration tips

Source: Internet
Author: User

 

Environment:
BEA WebLogic 9.1 Simplified Chinese Enterprise Edition

1. WebLogic domain definition

Generally, you can easily create and configure the database connection pool through the Configuration Wizard. Assume that I have configured a domain in the Wizard: C:/BEA/user_projects/domains/topicms_ora_wa9, which is the same as WebLogic 8.1.x, we will also find the connection file startweblogic in this folder. CMD (WebLogic application startup file), but "Rabbit is no longer in the nest", haha, this configuration file is a big flicker, don't worry about it! The real environment configuration file is configured in setdomainenv. CMD under the bin directory. I will explain how
Configure it.

2. WebLogic Data Source
After the domain is configured through the wizard, you usually need to configure the data source. You also need to go to the console to configure the data source and some other configuration items. Configuration process and 8. X is similar. In 9, there is also a config. XML file, but its meaning is no longer 8. You can manually change the config. XML files generally do not work, and all configurations must go through the console. This is where weblogic9 is dumb or silly to me! Therefore, after the configuration is complete, do not change config. XML in disorder. It is meaningless.

 

3. Configure setdomainenv. cmd
Weblogic9 is a file left for users to manually modify. The most important thing is setdomainenv. CMD, you can see from this file name what this is, huh, set (SET) domain (domain) ENV (Environment ), in fact, it is to set the running environment of your application, including the configuration of third-party packages. Debug port configuration and so on. I will give an example of my configuration, and use the highlighted color to distinguish it from each other. You will be able to figure it out.

---------------------------

@ Echo off

@ REM warning: this file is created by the Configuration Wizard.
@ REM any changes to this script may be lost when adding extensions to this configuration.

@ REM ************************************** ***********************************
@ REM this script is used to setup the needed environment to be able to start WebLogic Server in this domain.
@ Rem
@ REM this script initializes the following variables before calling commenv to set other variables:
@ Rem
@ REM wl_home-the BEA home directory of your WebLogic installation.
@ REM java_vm-the desired Java VM to use. You can set this environment variable before calling
@ REM this script to switch between sun or Bea or just have the default be set.

@ REM java_home-location of the version of java used to start WebLogic
@ REM server. depends directly on which java_vm value is set by default or by the environment.
@ REM user_mem_args-the variable to override the standard memory arguments
@ REM passed to Java.
@ REM production_mode-the variable that determines whether WebLogic Server is started in production mode.
@ REM domain_production_mode
@ REM-the variable that determines whether the workshop related settings like the debugger,
@ REM testconsole or iterativedev shoshould be enabled. Only settable using

@ REM command-line parameter named Production
@ REM Note: specifying the production command-line param will force

@ REM the server to start in production mode.
@ Rem
@ REM other variables used in this script include:
@ REM SERVER_NAME-name of the WebLogic Server.
@ 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
@ REM mem_args)
@ Rem
@ REM for additional information, refer to the Weblogic server administration
@ REM console online help (http://e-docs.bea.com/wls/docs91/ConsoleHelp/startstop.html ).
@ REM ************************************** ***********************************

Set wl_home = C:/BEA/weblogic91
For % I in ("% wl_home %") do set wl_home = % ~ FSI

Set bea_java_home = C:/BEA/jrockit90_150_04

Set sun_java_home = C:/jdk1.5.0 _ 05

If "% java_vendor %" = "Bea "(
Set java_home = % bea_java_home %
) Else (
If "% java_vendor %" = "sun "(
Set java_home = % sun_java_home %
) Else (
Set java_vendor = sun
Set java_home = C:/BEA/jdk150_04
)
)

@ REM we need to reset the value of java_home to get it shortened and

@ REM we can not shorten it abve because immediate variable expansion will blank it

Set java_home = % java_home %
For % I in ("% java_home %") do set java_home = % ~ FSI

Set samples_home = % wl_home %/Samples

Set domain_home = C:/BEA/user_projects/domains/topicms_ora_wl9
For % I in ("% domain_home %") do set domain_home = % ~ FSI

Set long_domain_home = C:/BEA/user_projects/domains/topicms_ora_wl9

If "% debug_port %" = ""(
Set debug_port = 8453
)

If "% SERVER_NAME %" = ""(
Set SERVER_NAME = adminserver
)

Set pointbase_flag = false

Set instrumentflag =

Set production_mode =

Set doexitflag = false
Set verboseloggingflag = false
For % P in (% *) Do call: set_param % P
Goto: pai_line_done
: Set_param
For % Q in (% 1) do set noquotesparam = % ~ Q
If/I "% noquotesparam %" = "nodebug "(
Set debugflag = false
Goto: EOF
)
If/I "% noquotesparam %" = "production "(
Set domain_production_mode = true
Goto: EOF
)
If/I "% noquotesparam %" = "notestconsole "(
Set testconsoleflag = false
Goto: EOF
)
If/I "% noquotesparam %" = "noiterativedev "(
Set iterativedevflag = false
Goto: EOF
)
If/I "% noquotesparam %" = "nologerrorstoconsole "(
Set logerrorstoconsoleflag = false
Goto: EOF
)
If/I "% noquotesparam %" = "nopointbase "(
Set pointbase_flag = false
Goto: EOF
)
If/I "% noquotesparam %" = "doexit "(
Set doexitflag = true
Goto: EOF
)
If/I "% noquotesparam %" = "noexit "(
Set doexitflag = false
Goto: EOF
)
If/I "% noquotesparam %" = "verbose "(
Set verboseloggingflag = true
Goto: EOF
)
If/I "% noquotesparam %" = "instrumentall "(
Set instrumentflag = all
Goto: EOF
)
If/I "% noquotesparam %" = "instrumentapps "(
Set instrumentflag = apps
Goto: EOF
) Else (
Set proxy_settings = % proxy_settings % 1
)
Goto: EOF
: Cmd_line_done

If not "% instrumentflag %" = ""(
Set instrumentflag =-dweblogic. Diagnostics. instrumentation = % instrumentflag %
)

Set mem_dev_args =

If "% domain_production_mode %" = "true "(
Set production_mode = % domain_production_mode %
)

If "% production_mode %" = "true "(
Set debugflag = false
Set testconsoleflag = false
Set iterativedevflag = false
)

@ REM if you want to override the default patch classpath, library path and path for this domain,
@ REM please uncomment the following lines and add a valid value for the Environment Variables
@ REM set patch_classpath = [mypatchclasspath] (Windows)
@ REM set patch_libpath = [mypatchlibpath] (Windows)
@ REM set patch_path = [mypatchpath] (Windows)
@ REM patch_classpath = [mypatchclasspath] (UNIX)
@ REM patch_libpath = [mypatchlibpath] (UNIX)
@ REM patch_path = [mypatchpath] (UNIX)

Call "% wl_home %/common/bin/commenv. cmd"

Set wls_home = % wl_home %/Server

Set wli_home = % wl_home %/Integration

Set mem_args =-xms256m-xmx512m

If "% java_vendor %" = "sun "(
If "% production_mode %" = ""(
Set mem_dev_args =-XX: compilethreshold = 8000-XX: permsize = 48 m
)
)

@ REM had to have a separate test here because of immediate Variable Expansion on Windows

If "% java_vendor %" = "sun "(
Set mem_args = % mem_args % mem_dev_args %-XX: maxpermsize = 128 m
)

If "% java_vendor %" = "HP "(
Set mem_args = % mem_args %-XX: maxpermsize = 128 m
)

@ REM if user_mem_args the environment variable is set, use it to override all mem_args values

If not "% user_mem_args %" = ""(
Set mem_args = % user_mem_args %
)

Set java_properties =-dplatform. Home = % wl_home %-dwls. Home = % wls_home %-dwli. Home = % wli_home %

@ REM to use Java authorization contract for containers (jacc) in this domain,

@ REM please uncomment the following section. If there are multiple machines in
@ REM your domain, be sure to edit the setdomainenv in the associated domain on
@ REM each machine.
@ Rem
@ REM-djava. Security. Manager
@ REM-djava. Security. Policy = Location of weblogic. Policy
@ REM-djavax. Security. jacc. Policy. provider = weblogic. Security. jacc. simpleprovider. simplejaccpolicy
@ REM-djavax. Security. jacc. policyconfigurationfactory. provider = weblogic. Security. jacc. simpleprovider. policyconfigurationfactoryimpl
@ REM-dweblogic. Security. jacc. rolemapperfactory. provider = weblogic. Security. jacc. simpleprovider. rolemapperfactoryimpl

Set java_properties = % java_properties % extra_java_properties %

Set ardir = % wl_home %/Server/lib

Pushd % long_domain_home %

@ REM clustering support (edit for your cluster !)

If "% admin_url %" = ""(
@ REM the then part of this block is telling us we are either starting an admin server or we are non-clustered
Set cluster_properties =-dweblogic. Management. Discover = true-dweblogic. productionmodeenabled = % production_mode %
) Else (
Set cluster_properties =-dweblogic. Management. Discover = false-dweblogic. Management. Server = % admin_url %
)

If not "% log4j_config_file %" = ""(
Set java_properties = % java_properties %-dlog4j. Configuration = file: % log4j_config_file %
)

Set java_properties = % java_properties % cluster_properties %

@ REM clear the pre_classpath here In case an application template wants to set it before the larger pre_classpath is invoked below

Set pre_classpath = % pre_classpath %; C:/BEA/user_projects/domains/topicms_ora_wa9/lib/log
Set pre_classpath = % pre_classpath %; C:/BEA/user_projects/domains/topicms_ora_wa9/lib/log4j-1.2.8.jar

Set-xdebug-xnoagent-djava. compiler = none-xrunjdwp: Transport = dt_socket, Server = Y, suspend = N, address = 5005

Set java_debug =

If "% debugflag %" = "true "(
Set java_debug =-xdebug-xnoagent-xrunjdwp: Transport = dt_socket, address = % debug_port %, Server = Y, suspend = N-djava. compiler = none
Set java_options = % java_options % instrumentflag %-Ea-da: COM. bea... -Da: javelin... -Da: Weblogic... -Ea: COM. bea. WLI... -Ea: COM. bea. broker... -Ea: COM. bea. sbconsole...
) Else (
Set java_options = % java_options % instrumentflag %-da
)

If not exist % java_home %/lib (
Echo the JRE was not found in directory % java_home %. ^ (java_home ^)
Echo Please edit your environment and set the java_home
Echo variable to point to the root directory of your Java installation.
Popd
Pause
Goto: EOF
)

If "% pointbase_flag %" = "true "(
Set database_classpath = % pointbase_classpath %
) Else (
Set database_classpath = % pointbase_client_classpath %
)

Set post_classpath =

Set post_classpath = % post_classpath %; % database_classpath %; % ardir %/xqrl. Jar

@ REM profiling support

Set java_profile =

Set server_class = weblogic. Server

Set java_properties = % java_properties % wlp_java_properties %

Set java_options = % java_options % java_properties %-dwlw. iterativedev = % iterativedevflag %-dwlw. testconsole = % testconsoleflag %-dwlw. logerrorstoconsole = % worker %

@ Rem -- Setup properties so that we can save stdout and stderr to files

If not "% wls_stdout_log %" = ""(
Echo logging WLS stdout to % wls_stdout_log %
Set java_options = % java_options %-dweblogic. stdout = % wls_stdout_log %
)

If not "% wls_stderr_log %" = ""(
Echo logging WLS stderr to % wls_stderr_log %
Set java_options = % java_options %-dweblogic. stderr = % wls_stderr_log %
)

@ REM add extensions to classpaths

If not "% ext_pre_classpath %" = ""(
Set pre_classpath = % ext_pre_classpath %; % pre_classpath %
)

If not "% ext_post_classpath %" = ""(
Set post_classpath = % post_classpath %; % ext_post_classpath %
)

If not "% weblogic_extension_dirs %" = ""(
Set java_options = % java_options %-dweblogic. Ext. dirs = % weblogic_extension_dirs %
)

Set java_options = % java_options %

@ REM set the classpath

Set classpath = % pre_classpath %; % weblogic_classpath %; % post_classpath %; % wlp_post_classpath %; % wl_home %/integration/lib/util. Jar

Set java_vm = % java_vm % java_debug % java_profile %

---------------------------

4. Deploy your application
Copy your war and ear packages to the autodeploy directory. Start Weblogic and check whether the deployment is successful. If not, you need to go to the console to view the status of each application. And change to activity status.

5. Start WebLogic
There are three methods to start. The first is to find the domain you configured in the Start menu to start, and the second is to start it from the startweblogic. CMD file in your domain directory. The third is to start startweblogic. CMD in the bin directory. In fact, the three startup methods are essentially the same, directly or indirectly calling the startweblogic. CMD file under bin!

Note:: Do not delete the myserver folder when you change the war and ear packages. Otherwise, the domain may be destroyed. On the contrary, you should do this in the 8 s. This is another silly place for Bea. There is no transition in the product. People who have used the 8 s may not be able to play 9, learn more from tomcat, Java, Oracle, and MySQL .. More secrets are waiting for you to discover in practice.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.