Thread: Cache Coordination RMI in Weblogic - problems

This question is answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 12 - Pages: 1 - Last Post: Dec 10, 2008 11:37 PM Last Post By: Prashanth Talap...
Prashanth Talap...

Posts: 9
Registered: 12/02/08
Cache Coordination RMI in Weblogic - problems
Posted: Dec 2, 2008 4:13 AM
 
Click to report abuse...   Click to reply to this thread Reply
Hi all,
I am trying to create a small ejb app which uses EclipseLink as its JPA provider and am trying to do cache coordination of the EclipseLink cache using RMI. When I try to run a standalone program using rmiregistry and rmi://localhost:1099 things work fine for me. I am able to start several instances of the program and do cache coordination. however, when I try to do this in weblogic the application runs but I dont get any cache coordination messages in the log. I get the following exception:

EL Warning: 2008.12.02 17:14:05.969--ServerSession(11247912)--Thread(ThreadThread-19,5,Pooled Threads)--Exception
EclipseLink-22102 (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not post connection in local naming service under name rmi://10.178.139.99:7001/a02f39ea-6aa4-4108-bb50-d69f8cb48be7
Internal Exception: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.io.EOFException
Exception in thread "Thread-19" Local Exception Stack:
Exception EclipseLink-22102 (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not post connection in local naming service under name rmi://10.178.139.99:7001/a02f39ea-6aa4-4108-bb50-d69f8cb48be7
Internal Exception: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.io.EOFException
at org.eclipse.persistence.exceptions.RemoteCommandManagerException.errorBindingConnection(RemoteCommandManagerException.java:87)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:172)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnection(RMITransportManager.java:125)
at org.eclipse.persistence.sessions.coordination.DiscoveryManager.run(DiscoveryManager.java:197)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.io.EOFException
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:286)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:169)
... 3 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:250)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:228)
... 8 more

This exception comes a couple of seconds after I run the query and get the results. Any help in solving this problem would be very helpful.

Thanks in advance,
Prashanth.
pvijayar

Posts: 6
Registered: 06/21/02
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 2, 2008 9:43 AM   in response to: Prashanth Talap... in response to: Prashanth Talap...
 
Click to report abuse...   Click to reply to this thread Reply
try using "t3" as the protocol instead of "rmi"
Prashanth Talap...

Posts: 9
Registered: 12/02/08
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 2, 2008 10:31 PM   in response to: Prashanth Talap... in response to: Prashanth Talap...
 
Click to report abuse...   Click to reply to this thread Reply
I tried using t3 instaed of rmi but i got a different exception. I guess it only works with RMI. But with RMI i get the same initial exception as mentioned in the first post of this thread. The exception when I use t3 instaed of RMI is as follows:

[EL Warning]: 2008.12.03 11:58:19.219--ServerSession(10382322)--Thread(Thread[Thread-19,5,Pooled Threads])--Exception
[EclipseLink-22102] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not post connection in local naming service under name t3://10.178.139.99:7001/18d1d962-f0b1-42b7-8a45-c9066282ac2b
Internal Exception: java.net.MalformedURLException: invalid URL scheme: t3://10.178.139.99:7001/18d1d962-f0b1-42b7-8a45-c9066282ac2b
Exception in thread "Thread-19" Local Exception Stack:
Exception [EclipseLink-22102] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not post connection in local naming service under name t3://10.178.139.99:7001/18d1d962-f0b1-42b7-8a45-c9066282ac2b
Internal Exception: java.net.MalformedURLException: invalid URL scheme: t3://10.178.139.99:7001/18d1d962-f0b1-42b7-8a45-c9066282ac2b
at org.eclipse.persistence.exceptions.RemoteCommandManagerException.errorBindingConnection(RemoteCommandManagerException.java:87)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:172)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnection(RMITransportManager.java:125)
at org.eclipse.persistence.sessions.coordination.DiscoveryManager.run(DiscoveryManager.java:197)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.MalformedURLException: invalid URL scheme: t3://10.178.139.99:7001/18d1d962-f0b1-42b7-8a45-c9066282ac2b
at java.rmi.Naming.intParseURL(Naming.java:273)
at java.rmi.Naming.parseURL(Naming.java:220)
at java.rmi.Naming.rebind(Naming.java:154)
at org.eclipse.persistence.sessions.coordination.rmi.RMITransportManager.createLocalConnectionInRegistry(RMITransportManager.java:169)
... 3 more
pvijayar

Posts: 6
Registered: 06/21/02
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 3, 2008 6:08 AM   in response to: Prashanth Talap... in response to: Prashanth Talap...
Helpful
Click to report abuse...   Click to reply to this thread Reply
Hi Prashanth,
I'm not sure how you've assembled your app together, but here's what I did to have EclipseLink Cachecoordination using WebLogic 10.3 (my domain has two managed servers, but not included in WL cluster):
#1. customize the session specific to each server URL (i.e MySessionCustomizer implements org.eclipse.persistence.config.SessionCustomizer)...see below for sample code.
#2. include server specific SessionCustomizer to each EAR (main difference between these customized classes is the URL, note that class name remains same for all)
#3. in your persistence.xml, include this class. For example:
<property name="eclipselink.session.customizer" value="examples.jpa.model.JPASessionCustomizer"/>
MySessionCustomizer implements org.eclipse.persistence.config.SessionCustomizer{
public void customize(Session session) {
RemoteCommandManager rcm = new RemoteCommandManager((DatabaseSessionImpl)session);
((DatabaseSessionImpl)session).setShouldPropagateChanges(true);
((DatabaseSessionImpl)session).setCommandManager(rcm);
rcm.setShouldPropagateAsynchronously(false);

/* discoveryManager settings */
((DatabaseSessionImpl)session).getCommandManager().getDiscoveryManager().setAnnouncementDelay(1000);
((DatabaseSessionImpl)session).getCommandManager().getDiscoveryManager().setMulticastGroupAddress("239.192.0.0");
((DatabaseSessionImpl)session).getCommandManager().getDiscoveryManager().setMulticastPort(3121);
((DatabaseSessionImpl)session).getCommandManager().getDiscoveryManager().setPacketTimeToLive(2);

/* jndi-naming-service */
rcm.getTransportManager().setNamingServiceType(TransportManager.JNDI_NAMING_SERVICE);
rcm.setUrl("t3://localhost:7011");
rcm.getTransportManager().setUserName(wlsUserName);
rcm.getTransportManager().setPassword(wlsPassword);

rcm.getTransportManager().setInitialContextFactoryName("weblogic.jndi.WLInitialContextFactory");
rcm.getTransportManager().setShouldRemoveConnectionOnError(true);
rcm.setServerPlatform(((org.eclipse.persistence.sessions.DatabaseSession)session).getServerPlatform());
rcm.initialize();

/* Sleep to allow RCM to startup and find each session. */
try {
Thread.sleep(2000);
} catch (Exception ignore) {
}
}

Let me know if you need further assistance.

regards,
Praba

Edited by: pvijayar on Dec 3, 2008 6:27 AM

Prashanth Talap...

Posts: 9
Registered: 12/02/08
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 3, 2008 7:29 AM   in response to: pvijayar in response to: pvijayar
 
Click to report abuse...   Click to reply to this thread Reply
Hi Prabha,
Thanks a lot for your reply. Unfortunately from your code snippet it seems you have used JMS to do cache coordination. I am using RMI to do cache coordination. I have created a SessionCustomizer and have added stuff to make cache coordination. The SessionCustomizer code is as follows:

public class EclipseLinkSessionCustomizer implements SessionCustomizer {

@Override
public void customize(Session session) throws Exception {
AbstractSession sessionImpl = (AbstractSession) session;
RemoteCommandManager rcm = new RemoteCommandManager(sessionImpl);
rcm.setShouldPropagateAsynchronously(false);
rcm.getDiscoveryManager().setAnnouncementDelay(10);
rcm.getTransportManager().setNamingServiceType(TransportManager.REGISTRY_NAMING_SERVICE);
rcm.setServerPlatform(sessionImpl.getServerPlatform());
rcm.setUrl("rmi://$HOST:7001");
sessionImpl.setCommandManager(rcm);
sessionImpl.setShouldPropagateChanges(true);
rcm.initialize();
try {
Thread.sleep(2000);
} catch(Exception ex) {
ex.printStackTrace();
}
}

}

Can you give me some tips as to what else I need to add.

Thanks in advance,
Prashanth.
pvijayar

Posts: 6
Registered: 06/21/02
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 3, 2008 9:09 AM   in response to: Prashanth Talap... in response to: Prashanth Talap...
Helpful
Click to report abuse...   Click to reply to this thread Reply
Are you deploying to respective managed servers?
From your code, you're trying to use default port(7001) which is usually for 'admin' server.
Normally, you start admin server, then managed server. Then, in my example, I create DS for managed servers only. Then, I deploy specific EAR to corresponding managed server.

just to make sure, you've created specific SessionCustomizer for EACH of your WL server instances?
Consider following scenario: (assuming you've a domain with one admin(7001) and two managed servers (7011, 7021) and they're NOT in weblogic cluster):
- ie. you would need to deploy ear with EclipseLinkSessionCustomizer with url set to 7011 (deploy to managed server which has port #7011), then do the samething with other servers.

In your domain config.xml, you must specify which one is adminserver, for example:
<server>
<name>myAdminServer</name>
<listen-address>localhost</listen-address>
</server>
<server>
<name>server1</name>
<listen-port>7011</listen-port>
<listen-address>localhost</listen-address>
</server>
<server>
<name>server2</name>
<listen-port>7021</listen-port>
<listen-address>localhost</listen-address>
</server>
<admin-server-name>myAdminServer</admin-server-name>

Few other things:
1. how you're starting the server is important too: do your servers 'hand-shake' (do they notify each other when they join RCM)?
2. if you model uses CacheType.SOFT, try changing that to CacheType.FULL (this could be set in persistence.xml and/or bean model class)
Prashanth Talap...

Posts: 9
Registered: 12/02/08
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 4, 2008 4:40 AM   in response to: pvijayar in response to: pvijayar
 
Click to report abuse...   Click to reply to this thread Reply
Hi Prabha,
Thanks for your valuable inputs. I will explain in this post my exact configuration. I am using Weblogic 10.3. I have created 2 managed servers (server1 and server2). I created a machine called machine-0 and added server1 and server2 as the servers for the machine. I also created a cluster called library-cluster made the messaging mode as multicast and set the multicast address and port as 226.10.12.64 and 3122 respectively. I also created a datasource and linked it to admin server, server1 and server2. Now I created an ejb app made an ear and deployed it in server1. I made a copy of the ejb app changed the entries in SessionCustomizer and deployed the second ejb on server 2. Now when I start the apps I should be seeing some kind of rmi messages being transfered between the 2 deployments cause i set up cache coordination thro rmi. But i dont see any such messages and I still get the same exception as mentioned in the 1st post. I am posting the copies of sessionCustomiser for both the ears. I am using @cache as follows in the pojos.

@Cache(type=CacheType.WEAK,
expiry=600000,
alwaysRefresh=true,
disableHits=false,
coordinationType=CacheCoordinationType.SEND_OBJECT_CHANGES)

Server1 SessionCustomizer:
public class EclipseLinkSessionCustomizer implements SessionCustomizer {

@Override
public void customize(Session session) throws Exception {
AbstractSession sessionImpl = (AbstractSession) session;
RemoteCommandManager rcm = new RemoteCommandManager(sessionImpl);
rcm.getDiscoveryManager().setMulticastGroupAddress("226.10.12.64");
rcm.getDiscoveryManager().setMulticastPort(3122);
rcm.setShouldPropagateAsynchronously(false);
rcm.getDiscoveryManager().setAnnouncementDelay(10);
rcm.getTransportManager().setNamingServiceType(TransportManager.REGISTRY_NAMING_SERVICE);
rcm.setServerPlatform(sessionImpl.getServerPlatform());
rcm.setUrl("rmi://$HOST:7011");
sessionImpl.setCommandManager(rcm);
sessionImpl.setShouldPropagateChanges(true);
rcm.initialize();
try {
Thread.sleep(2000);
} catch(Exception ex) {
ex.printStackTrace();
}
}

}

server2 sessionCustomizer:

public class EclipseLinkSessionCustomizer implements SessionCustomizer {

@Override
public void customize(Session session) throws Exception {
AbstractSession sessionImpl = (AbstractSession) session;
RemoteCommandManager rcm = new RemoteCommandManager(sessionImpl);
rcm.getDiscoveryManager().setMulticastGroupAddress("226.10.12.64");
rcm.getDiscoveryManager().setMulticastPort(3122);
rcm.setShouldPropagateAsynchronously(false);
rcm.getDiscoveryManager().setAnnouncementDelay(10);
rcm.getTransportManager().setNamingServiceType(TransportManager.REGISTRY_NAMING_SERVICE);
rcm.setServerPlatform(sessionImpl.getServerPlatform());
rcm.setUrl("rmi://$HOST:7021");
sessionImpl.setCommandManager(rcm);
sessionImpl.setShouldPropagateChanges(true);
rcm.initialize();
try {
Thread.sleep(2000);
} catch(Exception ex) {
ex.printStackTrace();
}
}

}

When I create a J2SE app without weblogic and try cachecorordination with rmi it works fine. I just need to start rmiregistry and start 2 instances of the standalone app and cache coordination happens cleanly with coordination rmi messages in the console which is seen using [EL-FINER].
I am trying to get it to work in weblogic and i dont see any [EL-FINER] cache coordination messages. There is no rmi initialization or initial registering with multicast ports either during app startup.

Please let me know if I am going wrong anywhere.

Thanks
Prashanth.

Gordon Yorke

Posts: 427
Registered: 06/21/02
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 5, 2008 5:37 AM   in response to: Prashanth Talap... in response to: Prashanth Talap...
Helpful
Click to report abuse...   Click to reply to this thread Reply
The most probable issue is the use of a registry from within WebLogic. All application servers use JNDI registries and WebLogic's RMI implementation may be incompatible with an RMI Registry. Switch the naming Service type to TransportManager.JNDI_NAMING_SERVICE. Also if you have created a WebLogic cluster the JNDI registry will be clustered as well so you should be able to use a single t3 URL but I may be incorrect on that part.
--Gordon
Prashanth Talap...

Posts: 9
Registered: 12/02/08
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 8, 2008 12:43 AM   in response to: Gordon Yorke in response to: Gordon Yorke
 
Click to report abuse...   Click to reply to this thread Reply
Hi all,
Thanks Gordon for the suggestion on the registry naming service. I guess it is a problem with the registry naming service, when I used JNDI_NAMING_SERVICE things worked fine... well at least I didn't get the aforementioned exception. Now I have a new problem which is an EclipseLink issue. As per Praba's suggestion I created 2 managed servers and did NOT attach them to the cluster I created in weblogic. So i just had 2 managed servers running on ports 7011 and 7021 respectively. I started my web app to test out cache coordination and initially I got the following messages in the logs of both the servers:

[EL Finer]: 2008.12.08 13:52:15.641--ServerSession(4702389)--Thread(Thread[Thread-12,5,Pooled Threads])--RCM service announcement sent out to cluster
[EL Finer]: 2008.12.08 13:52:15.641--ServerSession(4702389)--Thread(Thread[Thread-12,5,Pooled Threads])--RCM Discovery Manager active

I thought I had finally figured out how to do cache coordination using weblogic and EclipseLink but alas that was not the case.
I made a get by id query for an entity from server2 and made changes to the entity and persisted it back in the db. One would expect that this woould trigger a cache coordination between the EclipseLink caches of server 1 and server 2. However the log for server1 had no cahce coordination messages and the log for server2 had the following:

[EL Finer]: 2008.12.08 13:52:15.641--ServerSession(4245317)--Thread(Thread[Thread-12,5,Pooled Threads])--RCM service announcement received from Service[TopLinkCommandChannel, ca83c0a2-856f-47f7-a4a8-a0c4f877da3a, t3://10.178.139.99:7011]
[EL Warning]: 2008.12.08 13:52:16.375--ServerSession(4245317)--Thread(Thread[Thread-12,5,Pooled Threads])--Exception [EclipseLink-22103] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not look up remote connection under name ca83c0a2-856f-47f7-a4a8-a0c4f877da3a with URL t3://10.178.139.99:7011
Internal Exception: Exception [EclipseLink-7107] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Error encountered during string decryption.
Internal Exception: java.lang.NullPointerException

After this... if I try to do any operations which should result in cache coordination in server1 or server 2 I am not getting any RCM or cache coordination messages on the logs of either server. I think this seems to be an EclipseLink issue now. Any help from people who have faced such an issue earlier would be very helpful.

Thanks in advance,
Prashanth.
pvijayar

Posts: 6
Registered: 06/21/02
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 8, 2008 3:35 AM   in response to: Prashanth Talap... in response to: Prashanth Talap...
Helpful
Click to report abuse...   Click to reply to this thread Reply
Hi Prashanth,
To make things easier for triaging purpose, try following(within your current cluster environment):
1) try to use actual machinename(i.e mypc instead of localhost or IP address)....I vaguely remember RMI has inconsistent behaviour with IP address
2) As I mentioned before, try to setting following in your model and/or persistence.xml: CacheType.FULL, CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES
3) See if following test scenario works:
a) pre-populate db with an entity
b) open separate browser windows with server1 and server2
c) query for the specific entity, on both browsers
d) update this entity on server1
e) hit browser Refresh button to see changes on server2. Note: to make sure you're reading NOT from DB but cache, use query.setHint("eclipselink.cache-usage", "CheckCacheOnly");

regards,
Praba
Prashanth Talap...

Posts: 9
Registered: 12/02/08
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 8, 2008 4:30 AM   in response to: pvijayar in response to: pvijayar
 
Click to report abuse...   Click to reply to this thread Reply
Hi Praba,
I have tried everything you mentioned in your earlier post. I still seem to be getting the same problem. I guess this is some core EclipseLink issue which I am missing. I wonder if anyone else has faced such a problem before.

Thanks,
Prashanth.
cdelahun

Posts: 767
Registered: 06/25/02
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 8, 2008 8:37 AM   in response to: Prashanth Talap... in response to: Prashanth Talap...
 
Click to report abuse...   Click to reply to this thread Reply
Hello,

Is there any stack to the NullPointerException that would help narrow down where the problem is occuring? The exception is occuring when the Sessions are attempting to set up syncronization. If it is not successful, no synchronization will be attempted.

Regards,
Chris

Prashanth Talap...

Posts: 9
Registered: 12/02/08
Re: Cache Coordination RMI in Weblogic - problems
Posted: Dec 10, 2008 11:37 PM   in response to: cdelahun in response to: cdelahun
 
Click to report abuse...   Click to reply to this thread Reply
Hi all,
I have finally got it to work on weblogic 10.3. In this post I am going to give a detailed picture of what I did to get cache coordination through EclipseLink to work in an ejb application running on Oracle Weblogic 10.3.

Weblogic Configurations:

The admin server of weblogic runs on 7001 port. I created 2 managed servers through the weblogic console called server1 and server2. I created a machine called Machine0 and linked both server1 and server2 to Machine0 all in the console. Weblogic console also allows you to create a cluster, but it did NOT work for me when I created a cluster and associated server1 and server2 with the cluster. I created a datasource and attached it to server1 and server2. The main thing to remember here is that you create 2 managed servers and do not associate them with any cluster and just run them independently.

EclipseLink Configurations:

With an ejb app I had used annotations in my business objects (POJOS) and I had a persistence.xml file so I could not use a sessions.xml file to specify cache coordination settings. I created a custom session customizer by implementing SessionCustomizer. The code of my custom session customizer is as follows:

public class EclipseLinkSessionCustomizer implements SessionCustomizer {

public void customize(Session session) throws Exception {
RemoteCommandManager rcm = new RemoteCommandManager((DatabaseSessionImpl)session);
((DatabaseSessionImpl)session).setShouldPropagateChanges(true);
((DatabaseSessionImpl)session).setCommandManager(rcm);
rcm.setShouldPropagateAsynchronously(false);
((DatabaseSessionImpl)session).getCommandManager().getDiscoveryManager().setAnnouncementDelay(1000);
((DatabaseSessionImpl)session).getCommandManager().getDiscoveryManager().setMulticastGroupAddress("226.10.12.64");
((DatabaseSessionImpl)session).getCommandManager().getDiscoveryManager().setMulticastPort(3121);
((DatabaseSessionImpl)session).getCommandManager().getDiscoveryManager().setPacketTimeToLive(5);
rcm.getTransportManager().setNamingServiceType(TransportManager.JNDI_NAMING_SERVICE);
rcm.setUrl("t3://$HOST:7011"); // Use port 7011 for server1 and 7021 for server2
rcm.getTransportManager().setUserName("weblogic");
rcm.getTransportManager().setPassword("weblogic");
rcm.getTransportManager().setInitialContextFactoryName("weblogic.jndi.WLInitialContextFactory");
rcm.getTransportManager().setShouldRemoveConnectionOnError(true);
rcm.setServerPlatform(((org.eclipse.persistence.sessions.DatabaseSession)session).getServerPlatform());
rcm.initialize();
try {
Thread.sleep(2000);
} catch(Exception ex) {
ex.printStackTrace();
}
}

}

persistence.xml:

<?xml version="1.0" encoding="windows-1252" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="default" transaction-type="JTA">
<provider>
org.eclipse.persistence.jpa.PersistenceProvider
</provider>
<jta-data-source>BasicDS</jta-data-source>
<class>
com.talapala.library.objects.User
</class>
<class>
com.talapala.library.objects.Book
</class>
<class>
com.talapala.library.objects.Genre
</class>
<class>
com.talapala.library.objects.UserAccount
</class>
<properties>
<property name="eclipselink.target-server" value="WebLogic"/>
<property name="eclipselink.validate-existence" value="true"/>
<property name="eclipselink.logging.level" value="FINEST"/>
<property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.oracle.OraclePlatform"/>
<property name="javax.persistence.jtaDataSource" value="java:/app/jdbc/BasicDS"/>
<property name="eclipselink.application-location" value="."/>
<property name="eclipselink.ddl-generation.output-mode" value="both"/>
<property name="eclipselink.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
<property name="eclipselink.jdbc.url" value="jdbc:oracle:thin:@10.178.139.99:1521:XE"/>
<property name="eclipselink.session.customizer" value="com.talapala.library.eclipselink.EclipseLinkSessionCustomizer"/>
</properties>
</persistence-unit>
</persistence>

I created 2 ears one which i deployed in server1 and another in server2. Please note that the only change in the 2 ears is the port number changes in the custom session customizer file (7011 for server1 and 7021 for server2).

I started my application from server1 in one web browser window and did an operation which queries the db gets an object changes something in the object and persists it back in the db. I opened another browser window stated app from server 2 and did the same operation. In the server logs of server 1 and server2 you can see the cache coordination messages as follows:

[EL Finer]: 2008.12.11 13:05:26.953--ServerSession(5286698)--Thread(Thread[Thread-12,5,Pooled Threads])--RCM service announcement received from Service[TopLinkCommandChannel, 4be734db-b016-485d-80e0-acde8a485699, t3://10.178.139.99:7021]
[EL Finest]: 2008.12.11 13:05:26.953--ServerSession(5286698)--Thread(Thread[Thread-12,5,Pooled Threads])--Looking up remote connection in JNDI under name 4be734db-b016-485d-80e0-acde8a485699 at URL t3://10.178.139.99:7021
[EL Finest]: 2008.12.11 13:05:26.953--ServerSession(5286698)--Thread(Thread[Thread-12,5,Pooled Threads])--Remote context properties: {java.naming.provider.url=t3://10.178.139.99:7021, java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory, java.naming.security.principal=weblogic, dedicated.connection=true, java.naming.security.credentials=F44034A2DD8158AE77C605B1A51E3B46}
[EL Finest]: 2008.12.11 13:05:27.094--ServerSession(5286698)--Thread(Thread[Thread-12,5,Pooled Threads])--Received remote connection from Service[TopLinkCommandChannel, 4be734db-b016-485d-80e0-acde8a485699, t3://10.178.139.99:7021]
[EL Finest]: 2008.12.11 13:05:30.375--ServerSession(5286698)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Received remote command org.eclipse.persistence.sessions.coordination.MergeChangeSetCommand from Service[TopLinkCommandChannel, 4be734db-b016-485d-80e0-acde8a485699, t3://10.178.139.99:7021]
[EL Finest]: 2008.12.11 13:05:30.375--ServerSession(5286698)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Executing command org.eclipse.persistence.sessions.coordination.MergeChangeSetCommand from Service[TopLinkCommandChannel, 4be734db-b016-485d-80e0-acde8a485699, t3://10.178.139.99:7021]
[EL Finer]: 2008.12.11 13:05:30.375--ServerSession(5286698)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Received updates from Remote Server
[EL Finest]: 2008.12.11 13:05:30.375--ServerSession(5286698)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Merging com.talapala.library.objects.Book: [12] from remote server

I hope this post helps people who are stuck in making cache coordination work through RMI in EclipseLink. I would like to thank Prabaharan Vijayaratnam, who helped me figure this stuff out.

Regards,
Prashanth.

Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums