Skip Headers
Oracle® Fusion Middleware Spring Support in Oracle WebLogic Server
12c Release 1 (12.1.1)

Part Number E24975-01
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

5 Using WebLogic Server Clustering

This chapter describes how Spring applications can take advantage of WebLogic Server's clustering features. Because most Spring applications are packaged as Web applications (.war files), you do not need to do anything special in order to take advantage of WebLogic Server clusters. All you need to do is deploy your Spring application to the servers in a WebLogic Server cluster.

The certification of Spring 1.2.8, and 2.0, and 2.5.3 on WebLogic Server extends the Spring JndiRmiProxyFactoryBean and its associated service exporter so that it supports proxying with any Java EE RMI implementation. To use the extension to the JndiRmiProxyFactoryBean and its exporter:

  1. Configure client support by implementing code such as the following:

    <bean id="proProxy" 
        class="org.springframework.remoting.rmi.JndiRmiProxyFactoryBean">
      <property name="jndiName" value="t3://${serverName}:${rmiPort}/order"/>
      </property>
      <property name="jndiEnvironment">
        <props>
          <prop key="java.naming.factory.url.pkgs">weblogic.jndi.factories</prop>
        </props>
      </property>
      <property name="serviceInterface" 
        value="org.springframework.samples.jpetstore.domain.logic.OrderService"/>
    </bean>
    
  2. Configure the service exporter by implementing code such as the following:

    <bean id="order-pro" 
        class="org.springframework.remoting.rmi.JndiRmiServiceExporter">
      <property name="service" ref="petStore"/>
      <property name="serviceInterface" 
        value="org.springframework.samples.jpetstore.domain.logic.OrderService"/>
      <property name="jndiName" value="order"/>
    </bean>