geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v2.2 > EJB failover
Date Wed, 14 Jul 2010 06:53:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=GMOxDOC22&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxDOC22/EJB+failover">EJB
failover</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~chirunhua@gmail.com">Runhua
Chi</a>
    </h4>
        <br/>
                         <h4>Changes (9)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{panel} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">1</span><span
class="diff-added-chars"style="background-color: #dfd;">2</span>.</span> Developing
the client <br></td></tr>
            <tr><td class="diff-unchanged" >EJB clients must know the address
of EJB members to make sure that its request will be handled with high availability regardless
EJB members are clustered in *Multipoint* or *Multicast* way. <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{section} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">1</span><span
class="diff-added-chars"style="background-color: #dfd;">2</span>.</span> failover
strategies <br></td></tr>
            <tr><td class="diff-changed-lines" >OpenEJB supports 3 kinds of <span
class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">strategies
for</span> failover <span class="diff-added-words"style="background-color: #dfd;">strategies</span>
when the original node was shutdown abnormally. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br>{code:title=round-robin} <br>Properties p = new Properties(); <br>p.setProperty(Context.PROVIDER_URL,&quot;failover:round-robin:ejbd://foo:4201,ejbds://bar:4201,multicast://239.255.2.3:6142&quot;);
<br>... <br>{code} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >{section} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">{column:width=<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">3</span><span
class="diff-added-chars"style="background-color: #dfd;">5</span>0%}</span>
<br></td></tr>
            <tr><td class="diff-unchanged" >{code:title=sticky} <br>Properties
p = new Properties(); <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br>{column} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{column:width=30%}</span>
<span class="diff-added-words"style="background-color: #dfd;"> </span> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{code:title=round-robin}</span>
<span class="diff-added-words"style="background-color: #dfd;">{column:width=50%}</span>
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Properties
p = new Properties(); <br>p.setProperty(Context.PROVIDER_URL,&quot;failover:round-robin:ejbd://foo:4201,ejbds://bar:4201,multicast://239.255.2.3:6142&quot;);
<br>... <br>{code} <br>{column} <br>{column} <br>{column:width=30%}
<br></td></tr>
            <tr><td class="diff-unchanged" >{code:title=random} <br>Properties
p = new Properties(); <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>h1. Enabling unicast failover
 <br></td></tr>
            <tr><td class="diff-changed-lines" >Starting from Geronimo <span
class="diff-changed-words">2.2.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">1</span><span
class="diff-added-chars"style="background-color: #dfd;">2</span>,</span> *unicast-based*
support is provided. WADI can be configured to use unicast instead of multicast to support
failover for Stateless Session Bean. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h2. Understanding unicast
support in Geronimo <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
width='33%' class='ScrollbarPrevName'>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC22/Clustering+and+farming"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC22/Clustering+and+farming">Clustering and farming</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/GMOxDOC22/Farming+using+Deployment">Farming
using Deployment</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/GMOxDOC22/Farming+using+Deployment"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>

<p>In Geronimo, you can configure <a href="http://openejb.apache.org/3.0/failover.html"
title="OpenEJB failover" class="external-link" rel="nofollow">OpenEJB for failover scenarios</a>,
such as multipoint and multicast. Further more, Geronimo uses WADI to support failover for
Stateful Session Bean (SFSB) in a unicast way.</p>

<div>
<ul>
    <li><a href='#EJBfailover-Enablingmultipoint%2Fmulticastfailover'>Enabling
multipoint/multicast failover</a></li>
<ul>
    <li><a href='#EJBfailover-Developingtheclient'>Developing the client</a></li>
    <li><a href='#EJBfailover-failoverstrategies'>failover strategies</a></li>
</ul>
    <li><a href='#EJBfailover-Enablingunicastfailover'>Enabling unicast failover</a></li>
<ul>
    <li><a href='#EJBfailover-UnderstandingunicastsupportinGeronimo'>Understanding
unicast support in Geronimo</a></li>
    <li><a href='#EJBfailover-EnablingunicastsupportinGeronimo'>Enabling unicast
support in Geronimo</a></li>
    <li><a href='#EJBfailover-Configuringtheapplication'>Configuring the application</a></li>
    <li><a href='#EJBfailover-configuringtheclient'>configuring the client</a></li>
</ul>
</ul></div>

<h1><a name="EJBfailover-Enablingmultipoint%2Fmulticastfailover"></a>Enabling
multipoint/multicast failover </h1>
<p>By default, OpenEJB can use either <b>multicast</b> or <b>multipoint</b>
strategies for failover scenarios. Basically the server cluster members maintain membership
information using heartbeats and the ejb client maintains a list of servers to change target
server based on availability. Each heartbeat packet contains a single URI that advertises
a service, its cluster group, and its location in the form of "cluster1:ejb:ejbd://thehost:4201".
</p>

<p>By updating different attributes in <tt>config-substitutions.properties</tt>
file, you can choose appropriate discovery strategies in your cluster.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Multicast </th>
<th class='confluenceTh'> MultiPoint</th>
</tr>
<tr>
<td class='confluenceTd'> ServerHostname=&lt;LocalIP&gt;<br class="atl-forced-newline"
/>
MulticastEnabled=true </td>
<td class='confluenceTd'> ServerHostname=&lt;LocalIP&gt;<br class="atl-forced-newline"
/>
MultipointEnable=true<br class="atl-forced-newline" />
MultipointServers=&lt;Remotehost/IP&gt;:&lt;port&gt;</td>
</tr>
</tbody></table>
</div>

<p>where </p>
<ul>
	<li><em>LocalIP</em> is the ip address of the current node</li>
	<li><em>Remotehost/IP</em> is the host name or IP address of EJB member(s)
in a cluster.</li>
	<li><em>port</em> is the port number used to communicate with remote node.
The port must not be the default openEJB server port 4201.</li>
</ul>


<p>Note that for multicast scenario, you have to set <tt>openejb.client.requestretry
property</tt> to <em>true</em> when starting up Geronimo server. For example</p>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<p>./geronimo.sh run --long -Dopenejb.client.requestretry=true</p>
</div></div>

<h2><a name="EJBfailover-Developingtheclient"></a>Developing the client</h2>
<p>EJB clients must know the address of EJB members to make sure that its request will
be handled with high availability regardless EJB members are clustered in <b>Multipoint</b>
or <b>Multicast</b> way.</p>

<p>Refer to the following code snippet for your client application development for remote
host lookup.</p>
<table class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><tbody><tr>
<td class="confluenceTd" valign="top" width="50%">
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>URI for Multicast</b></div><div
class="codeContent panelContent">
<pre class="code-java">
Properties p = <span class="code-keyword">new</span> Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY, <span class="code-quote">"org.apache.openejb.client.RemoteInitialContextFactory"</span>);
p.setProperty(Context.PROVIDER_URL,<span class="code-quote">"multicast:<span class="code-comment">//239.255.3.2:6142?group=cluster1"</span>);
</span>...
</pre>
</div></div></td>
<td class="confluenceTd" valign="top" width="50%">
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>URI for Multipoint/Unicast</b></div><div
class="codeContent panelContent">
<pre class="code-java">
Properties p = <span class="code-keyword">new</span> Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY, <span class="code-quote">"org.apache.openejb.client.RemoteInitialContextFactory"</span>);
p.setProperty(Context.PROVIDER_URL,<span class="code-quote">"failover:ejbd:<span
class="code-comment">//ejbd://foo:4201"</span>);
</span>...
</pre>
</div></div></td></tr></tbody></table>

<h2><a name="EJBfailover-failoverstrategies"></a>failover strategies </h2>
<p>OpenEJB supports 3 kinds of failover strategies when the original node was shutdown
abnormally. </p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>round-robin</b></div><div class="codeContent
panelContent">
<pre class="code-java">
Properties p = <span class="code-keyword">new</span> Properties();
p.setProperty(Context.PROVIDER_URL,<span class="code-quote">"failover:round-robin:ejbd:<span
class="code-comment">//foo:4201,ejbds://bar:4201,multicast://239.255.2.3:6142"</span>);
</span>...
</pre>
</div></div>

<table class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><tbody><tr>
<td class="confluenceTd" valign="top" width="50%">
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>sticky</b></div><div class="codeContent
panelContent">
<pre class="code-java">
Properties p = <span class="code-keyword">new</span> Properties();
p.setProperty(Context.PROVIDER_URL,<span class="code-quote">"failover:ejbd:<span
class="code-comment">//foo:4201,ejbd://bar:4201"</span>);
</span>...
</pre>
</div></div></td>

<td class="confluenceTd" valign="top" width="50%">
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>random</b></div><div class="codeContent
panelContent">
<pre class="code-java">
Properties p = <span class="code-keyword">new</span> Properties();
p.setProperty(Context.PROVIDER_URL,<span class="code-quote">"failover:random:ejbd:<span
class="code-comment">//foo:4201,ejbd://bar:4201"</span>);
</span>...
</pre>
</div></div></td></tr></tbody></table>

<h1><a name="EJBfailover-Enablingunicastfailover"></a>Enabling unicast failover
</h1>
<p>Starting from Geronimo 2.2.2, <b>unicast-based</b> support is provided.
WADI can be configured to use unicast instead of multicast to support failover for Stateless
Session Bean. </p>

<h2><a name="EJBfailover-UnderstandingunicastsupportinGeronimo"></a>Understanding
unicast support in Geronimo</h2>

<p>The following server configurations, shipped out-of-the-box with the Java EE assemblies,
must be installed and enabled for unicast EJB failover to work:</p>
<ul>
	<li><em>org.apache.geronimo.configs/openejb-clustering-wadi//car</em>:
it defines runtime dependencies and OpenEJB clustering contracts.</li>
	<li><em>org.apache.geronimo.configs/openejb-clustering-builder-wadi//car</em>:
it defines deployment time dependencies along with a <em>OpenEJBClusteringBuilder</em>
GBean declaring the default clustering configuration.</li>
</ul>


<p>This configuration must be running when a cluster is started. If it is not, then
the substitution group <em>openejb-clustering-wadi</em> is not properly recognized
and the deployment fails.</p>

<h2><a name="EJBfailover-EnablingunicastsupportinGeronimo"></a>Enabling
unicast support in Geronimo</h2>
<p>To enable unicast-based failover for Stateless Session Bean, the <tt>wadi-clustering</tt>
module in <tt>&lt;GERONIMO_HOME&gt;/var/config/config.xml</tt> should
be configured for each server node. You must specify the real IP address to <em>ServerHostname</em>
 and the node name to <em>ClusterNodeName</em> for each static member in <tt>config-substitutions.properties</tt>
file. Each member has its own GBean configuration in the <tt>wadi-cluster</tt>
module in <tt>config.xml</tt>. Ensure that you define all the static members in
it. The following example shows the configuration with two static members.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
...
<span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/wadi-clustering/2.2.1-SNAPSHOT/car"</span>&gt;</span>
	<span class="code-tag">&lt;gbean name=<span class="code-quote">"DefaultBackingStrategyFactory"</span>&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"nbReplica"</span>&gt;</span>${ReplicaCount}<span
class="code-tag">&lt;/attribute&gt;</span>
	<span class="code-tag">&lt;/gbean&gt;</span>
	<span class="code-tag">&lt;gbean name=<span class="code-quote">"DefaultDispatcherHolder"</span>&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"disableMCastService"</span>&gt;</span>true<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"receiverPort"</span>&gt;</span>4002<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"endPointURI"</span>&gt;</span>${EndPointURI}<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"clusterName"</span>&gt;</span>${WADIClusterName}<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;reference name=<span class="code-quote">"staticMember"</span>&gt;</span>
			<span class="code-tag">&lt;pattern&gt;</span>
				<span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.configs<span
class="code-tag">&lt;/groupId&gt;</span>
				<span class="code-tag">&lt;artifactId&gt;</span>wadi-clustering<span
class="code-tag">&lt;/artifactId&gt;</span>
				<span class="code-tag">&lt;version&gt;</span>2.2.1-SNAPSHOT<span
class="code-tag">&lt;/version&gt;</span>
				<span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
				<span class="code-tag">&lt;name&gt;</span>firstStaticMember<span
class="code-tag">&lt;/name&gt;</span>
			<span class="code-tag">&lt;/pattern&gt;</span>
		<span class="code-tag">&lt;/reference&gt;</span>
	<span class="code-tag">&lt;/gbean&gt;</span>
	&lt;gbean name=<span class="code-quote">"org.apache.geronimo.configs/wadi-clustering/2.2.1-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/wadi-clustering/2.2.1-SNAPSHOT/car,j2eeType=GBean,name=firstStaticMember"</span>
		gbeanInfo=<span class="code-quote">"org.apache.geronimo.clustering.wadi.WadiStaticMember"</span>&gt;
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"className"</span>&gt;</span>org.apache.catalina.tribes.membership.StaticMember<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>4002<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"securePort"</span>&gt;</span>-1<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"domain"</span>&gt;</span>test-domain<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"UniqueId"</span>&gt;</span>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>Node1_IP<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;reference name=<span class="code-quote">"nextWadiStaticMember"</span>&gt;</span>
			<span class="code-tag">&lt;pattern&gt;</span>
				<span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.configs<span
class="code-tag">&lt;/groupId&gt;</span>
				<span class="code-tag">&lt;artifactId&gt;</span>wadi-clustering<span
class="code-tag">&lt;/artifactId&gt;</span>
				<span class="code-tag">&lt;version&gt;</span>2.2.1-SNAPSHOT<span
class="code-tag">&lt;/version&gt;</span>
				<span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
				<span class="code-tag">&lt;name&gt;</span>secondStaticMember<span
class="code-tag">&lt;/name&gt;</span>
			<span class="code-tag">&lt;/pattern&gt;</span>
		<span class="code-tag">&lt;/reference&gt;</span>
	<span class="code-tag">&lt;/gbean&gt;</span>
	&lt;gbean name=<span class="code-quote">"org.apache.geronimo.configs/wadi-clustering/2.2.1-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/wadi-clustering/2.2.1-SNAPSHOT/car,j2eeType=GBean,name=secondStaticMember"</span>
		gbeanInfo=<span class="code-quote">"org.apache.geronimo.clustering.wadi.WadiStaticMember"</span>&gt;
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"className"</span>&gt;</span>org.apache.catalina.tribes.membership.StaticMember<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>4003<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"securePort"</span>&gt;</span>-1<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"domain"</span>&gt;</span>test-domain<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"UniqueId"</span>&gt;</span>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>Node2_IP<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;reference name=<span class="code-quote">"nextWadiStaticMember"</span>
/&gt;</span>
	<span class="code-tag">&lt;/gbean&gt;</span>
<span class="code-tag">&lt;/module&gt;</span>
...
</pre>
</div></div>

<p>where</p>

<p><em>Node1_IP</em> is the IP address of the first server node.<br/>
<em>Node2_IP</em> is the IP address of the second server node. </p>

<h2><a name="EJBfailover-Configuringtheapplication"></a>Configuring the
application</h2>

<p>The Geronimo-specific deployment plan for an EJB application, which is usually packaged
as an EJB JAR file, is called <b>"openejb-jar.xml"</b>. The <b>openejb-jar.xml</b>
deployment plan is used to in conjunction with the <b>ejb-jar.xml</b> Java EE
deployment plan to deploy enterprise applications to the Geronimo application server. </p>

<p>To enable WADI configuration for your application, add <tt>openejb-clustering-wadi</tt>
into the deployment plan as followed:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
&lt;ejb-jar xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0"</span>

         <span class="code-keyword">xmlns:wadi</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/openejb-clustering-wadi-1.2"</span>&gt;

...
   <span class="code-tag">&lt;wadi:openejb-clustering-wadi&gt;</span>
      <span class="code-tag">&lt;wadi:deltaReplication&gt;</span>false<span
class="code-tag">&lt;/wadi:deltaReplication&gt;</span>
   <span class="code-tag">&lt;/wadi:openejb-clustering-wadi&gt;</span>
<span class="code-tag">&lt;/ejb-jar&gt;</span>
</pre>
</div></div>

<h2><a name="EJBfailover-configuringtheclient"></a>configuring the client</h2>

<p>An application client must find an EJB node and make sure the client could find the
second node when the original one is shutdown abnormally in a unicast scenario. Use the following
code snippet when programming.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
Properties p = <span class="code-keyword">new</span> Properties();

p.setProperty(Context.INITIAL_CONTEXT_FACTORY, <span class="code-quote">"org.apache.openejb.client.RemoteInitialContextFactory"</span>);

p.setProperty(Context.PROVIDER_URL,<span class="code-quote">"ejbd:<span class="code-comment">//foo:4201"</span>);
  
</span>Context context1 = <span class="code-keyword">new</span> InitialContext(p);
...
p.setProperty(Context.PROVIDER_URL,<span class="code-quote">"ejbd:<span class="code-comment">//bar:4201"</span>);
</span>
Context context2 = <span class="code-keyword">new</span> InitialContext(p);
</pre>
</div></div>





    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC22/EJB+failover">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=21791056&revisedVersion=24&originalVersion=23">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC22/EJB+failover?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message