Tuesday, September 8, 2009

Using Weblogic Clusters

http://download.oracle.com/docs/cd/E13222_01/wls/docs103/cluster/index.html

Cluster configuration
http://download.oracle.com/docs/cd/E13222_01/wls/docs103/cluster/config.html

Setting up WebLogic Clusters
http://download.oracle.com/docs/cd/E13222_01/wls/docs103/cluster/setup.html

Cluster Architectures
http://download.oracle.com/docs/cd/E13222_01/wls/docs103/cluster/planning.html#wp1028504


 <server>
<name>AdminServer</name>
<machine>Machine_1</machine>
<listen-address></listen-address>
</server>
<server>
<name>ManagedServer_1</name>
<machine>Machine_1</machine>
<listen-port>7002</listen-port>
<cluster>Cluster_1</cluster>
<listen-address>localhost</listen-address>
<jta-migratable-target>
<user-preferred-server>ManagedServer_1</user-preferred-server>
<cluster>Cluster_1</cluster>
</jta-migratable-target>
</server>
<server>
<name>ManagedServer_2</name>
<machine>Machine_1</machine>
<listen-port>7003</listen-port>
<cluster>Cluster_1</cluster>
<listen-address>localhost</listen-address>
<jta-migratable-target>
<user-preferred-server>ManagedServer_2</user-preferred-server>
<cluster>Cluster_1</cluster>
</jta-migratable-target>
</server>
<cluster>
<name>Cluster_1</name>
<multicast-address>239.192.0.0</multicast-address>
<multicast-port>7005</multicast-port>
<cluster-messaging-mode>multicast</cluster-messaging-mode>
</cluster>



 <machine>
<name>Machine_1</name>
<node-manager>
<name>Machine_1</name>
<listen-address>localhost</listen-address>
</node-manager>
</machine>
<migratable-target>
<name>ManagedServer_1 (migratable)</name>
<notes>This is a system generated default migratable target for a server. Do not delete manually.</notes>
<user-preferred-server>ManagedServer_1</user-preferred-server>
<cluster>Cluster_1</cluster>
</migratable-target>
<migratable-target>
<name>ManagedServer_2 (migratable)</name>
<notes>This is a system generated default migratable target for a server. Do not delete manually.</notes>
<user-preferred-server>ManagedServer_2</user-preferred-server>
<cluster>Cluster_1</cluster>
</migratable-target>
<admin-server-name>AdminServer</admin-server-name>

Thursday, September 3, 2009

EJB client connecting to Weblogic

Lookup service for EJB

requires wlfullclient.jar or wlthint3client.jar on classpath (must be first)

http://docs.oracle.com/cd/E17904_01/web.1111/e13717/wlthint3client.htm
http://docs.oracle.com/cd/E17904_01/web.1111/e13717/basics.htm#i1068418

    public void lookupService()  {
try {
Properties props = new Properties();
props.put(Context.PROVIDER_URL, "t3://localhost:7001");
props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
Context ctx = new InitialContext(props);
service = (TestTimer) ctx.lookup("ejb/TestTimer#testEAR.TestTimer");
} catch (NamingException e) {
e.printStackTrace();
}
}