BEA WebLogic 9.x New Features and Configuration Gems, Page 2
Gem: Note the big difference in the memory requirements between 8.x and 9.x servers. If you want to decrease the memory for the admin server running the web configuration console, you need to change the mem_args parameter to the VM, in the shell script.
mem_args for WL9 in the startWeblogic script (or remote params for admin server in the web console)
set MEM_ARGS=-Xms64M -Xmx256M -XX:CompileThreshold=8000 -XX:PermSize=48M -XX:MaxPermSize=128M
By default, the settings go up to 512mb—a bit large just to run one web app console.
Cluster configuration tips
WebLogic 9.x offers some of the best features for application clustering and failover among other application servers in the industry. The distributed WebLogic Server instances are controlled with the Node Manager utility. The Node Manager is an independent process, not associated with a specific WebLogic domain instance, but with a machine.
If you are running a cluster or want to run one, the configuration is much easier with 9.x than with 8.x. Here is the example of how a cluster domain should look.
On the application level, you need to add a <distributable/> tag in the generic web.xml, and of course make sure all of your objects associated with user sessions are serializable.
Here is an example of Web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <display-name>WebAppWeb</display-name> <distributable/> <servlet> <servlet-name>search</servlet-name> <display-name>Search Servlet</display-name> <servlet-class>com.someapp.MyServlet</servlet-class> </servlet> ***** </web-app>
Also, at the application level, you can indicate a replication parameter for cluster environment in the WebLogic's specific configuration file. The PersistentStoreType sets the persistent store method to one of the following options:
- memory: Disables persistent session storage.
- file: Uses file-based persistence (see PersistentStoreDir, above).
- jdbc: Uses a database to store persistent sessions (see PersistentStorePool, above).
- replicated: Same as memory, but session data is replicated across the clustered servers.
- cookie: All session data is stored in a cookie in the user's browser.
- replicated_if_clustered: If the Web application is deployed on a clustered server, the in-effect PersistentStoreType will be replicated. Otherwise, memory is the default.
Here is a sample of Weblogic.xml with this parameter:
<?xml version="1.0"?> <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd"> <weblogic-web-app> <session-descriptor> <session-param> <param-name>PersistentStoreType</param-name> <param-value>replicated</param-value> </session-param> </session-descriptor> <context-root>app_name</context-root> </weblogic-web-app>
This article talked about some of the configuration gems for the latest BEA WebLogic Sever 9.x that I personally found very useful. It discussed some of the most important new features and presented configuration gems on application, IDE, and the cluster level. The WebLogic 9.x includes a lot of evolutionally enhancements, in its architecture, web console, and overall structure that make it a very capable application server. It will be very interesting to see what BEA will introduce in the future releases.
- Production-time Redeployment of Applications in WebLogic Server 9.0:http://dev2dev.bea.com/pub/a/2005/09/production_reployment.html
- Deploying Clusters: http://edocs.bea.com/wlp/docs40/deploygd/cluster.htm
- Deploying Applications to WebLogic Server: http://e-docs.bea.com/wls/docs90/deployment/index.html
- Updating Applications in a Production Environment: http://e-docs.bea.com/wls/docs90/deployment/redeploy.html
- Using Node Manager to Control Servers: http://e-docs.bea.com/wls/docs90/server_start/nodemgr.html
About the Author
Vlad Kofman works on enterprise-scale projects for major Wall Street firms. He also has worked on the defense contracts for the U.S. government. His main interests are object-oriented programming methodologies, UI, and the design patterns.
Page 2 of 2