Coherence Based WebLogic Server Session Management

Posted by [email protected] on Oracle Blogs See other posts from Oracle Blogs or by [email protected]
Published on Thu, 01 Apr 2010 05:03:58 +0000 Indexed on 2010/04/01 5:13 UTC
Read the original article Hit count: 718

Filed under:

Specifications

Supported Configurations

  • WebLogic Server 10.3.2( or 10.3.1 )
  • Coherence 3.5.2/463

If you use other verion above, then please check the following matrix:

  WebLogic Server 9.2 MP1 Weblogic Server 10.3
WebLogic Smart Update Patch ID: AJQB Patch ID: 6W2W
Minimum Coherence Release Level/MetaLink Patch ID 3.4.2 Patch 2-Patch ID:8429415 3.4.2 Patch6-Patch ID:11399293

Environment Variables

%COHERENCE_HOME%: coherence installation directory

%DOMAIN_HOME%: weblogic domain foler.

Instructions

We Will create to weblogic domains: domain_a, domain_b. To configure those domains with coherence-based session management . Then the changings of session variable value in one domain will propagate to another domain.

Main Steps

WebLogic Server

  1. create domain_a
    The process is ignored
  2. copy %COHERENCE_HOME%\lib\coherence.jar to %DOMAIN_HOME%\lib
  3. startup domain
  4. deploy %COHERENCE_HOME%\lib\coherence-web-spi.war as a Shared Library
  5. repeat step 1~4 at domain_b

Coherence

  1. duplicate %COHERENCE_HOME%\bin\cache-server.cmd at the same folder and rename it to web-cache-server.cmd
  2. modify web-cache-server.cmd
    java -server -Xms512m -Xmx512m -cp %coherence_home%/lib/coherence.jar;%coherence_home%/lib/coherence-web-spi.war -Dtangosol.coherence.management.remote=true -Dtangosol.coherence.cacheconfig=WEB-INF/classes/session-cache-config.xml -Dtangosol.coherence.session.localstorage=true com.tangosol.net.DefaultCacheServer
  3. startup web-cache-server.cmd

Testing

  1. develop a web app  with OEPE or JDeveloper and implment functions: changing, viewing, listing  session variables. ( or download sample codes here )
  2. modify weblogic.xml with following content:
    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-web-app xmlns:wls=http://xmlns.oracle.com/weblogic/weblogic-web-app
     xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
     http://xmlns.oracle.com/weblogic/weblogic-web-app
     http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
        <wls:weblogic-version>10.3.2</wls:weblogic-version>
        <wls:context-root>CoherenceWeb</wls:context-root>
        <wls:library-ref>
            <wls:library-name>coherence-web-spi</wls:library-name>
            <wls:specification-version>1.0.0.0</wls:specification-version>
            <wls:exact-match>true</wls:exact-match>
        </wls:library-ref>
    </wls:weblogic-web-app>
  3. deploy the web app to domain_a and domain_b
  4. change session varaible vlaue at domain_a and check whethe if changed at domain_b

References

© Oracle Blogs or respective owner