[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Problem using RMI replication  XML
Forum Index -> Ehcache
Author Message
loulou

neo

Joined: 09/19/2013 12:15:20
Messages: 4
Offline

Hi,

I am new to using ehcache. I have two CAS nodes behind a f5 load balancer and my goal is to do ehcache rmi replication.

I added the ehcache-core 2.6.6 as a dependency and I had followed these instructions https://wiki.jasig.org/display/CASUM/EhcacheTicketRegistry

But I am not sure what this error means and need some guidance:

ERROR [net.sf.ehcache.distribution.RMISynchronousCacheReplicator] - <Exception on replication of putNotification. error marshalling arguments; nested exception is:
java.net.SocketException: Broken pipe. Continuing...>
java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.net.SocketException: Broken pipe
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:138)
at net.sf.ehcache.distribution.RMICachePeer_Stub.put(Unknown Source)
at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.replicatePutNotification(RMISynchronousCacheReplicator.java:149)
at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.notifyElementPut(RMISynchronousCacheReplicator.java:132)
...
ERROR [net.sf.ehcache.distribution.RMISynchronousCacheReplicator] - <Exception on replication of removeNotification. no such object in table. Continuing...>
java.rmi.NoSuchObjectException: no such object in table
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)

I have manual peer discovery setup
Code:
 #On Node 1:
 <cacheManagerPeerProviderFactory
        class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
                 properties="peerDiscovery=manual,rmiUrls=//<node 2>:41001/org.jasig.cas.ticket.ServiceTicket|//<node 2>:41001/org.jasig.cas.ticket.TicketGrantingTicket" />
         <cacheManagerPeerListenerFactory
                 class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
                 properties="port=41001,remoteObjectPort=41002" />
 
 #On Node 2:
 <cacheManagerPeerProviderFactory
        class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
                 properties="peerDiscovery=manual,rmiUrls=//<node 1>:41001/org.jasig.cas.ticket.ServiceTicket|//<node 1>:41001/org.jasig.cas.ticket.TicketGrantingTicket" />
         <cacheManagerPeerListenerFactory
                 class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
                 properties="port=41001,remoteObjectPort=41002" />
 


There's so much information to include, if I'm forgetting anything useful that may help, let me know an I can provide it.

Thanks
jawah

neo

Joined: 11/18/2013 14:25:27
Messages: 2
Offline

I'm having the same problem. The difference is I have 4 nodes. The replication from node1 to node2 takes place, node1 to node3 takes place, but node1 to node4 doesn't take place

The error for node1 to node4 is

[Replication Thread] WARN n.s.e.d.RMIAsynchronousCacheReplicator - Unable to send message to remote peer. Message was: error marshalling arguments; nested exception is:
java.net.SocketException: Broken pipe
java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.net.SocketException: Broken pipe
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:138) ~[na:1.6.0_45]
at net.sf.ehcache.distribution.RMICachePeer_Stub.send(Unknown Source) ~[ehcache-2.7.2.jar:2.7.2]
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.writeReplicationQueue(RMIAsynchronousCacheReplicator.java:314) [ehcache-2.7.2.jar:2.7.2]
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.replicationThreadMain(RMIAsynchronousCacheReplicator.java:127) [ehcache-2.7.2.jar:2.7.2]
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.access$000(RMIAsynchronousCacheReplicator.java:58) [ehcache-2.7.2.jar:2.7.2]
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator$ReplicationThread.run(RMIAsynchronousCacheReplicator.java:389) [ehcache-2.7.2.jar:2.7.2]
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:1.6.0_45]
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) ~[na:1.6.0_45]
at java.net.SocketOutputStream.write(SocketOutputStream.java:136) ~[na:1.6.0_45]
at java.net.ManagedSocketOutputStreamHighPerformanceNew.write(ManagedSocketOutputStreamHighPerformanceNew.java:375) ~[na:1.6.0_45]
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) ~[na:1.6.0_45]
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:109) ~[na:1.6.0_45]
at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1847) ~[na:1.6.0_45]
at java.io.ObjectOutputStream$BlockDataOutputStream.writeByte(ObjectOutputStream.java:1885) ~[na:1.6.0_45]
at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1546) ~[na:1.6.0_45]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:333) ~[na:1.6.0_45]
at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:274) ~[na:1.6.0_45]
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133) ~[na:1.6.0_45]
... 5 common frames omitted


Any help would be highly appreciated.


loulou

neo

Joined: 09/19/2013 12:15:20
Messages: 4
Offline

I still haven't found a solution. I shutdown my iptables just to be certain that the ports were open. But still after everything I still see this error:

DEBUG Replication Thread [net.sf.ehcache.distribution.RMICacheManagerPeerProvider] - Lookup URL //<node1>:41001/org.jasig.cas.ticket.TicketGrantingTicket
2013-11-20 15:14:42,203 WARN Replication Thread [net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator] - Unable to send message to remote peer. Message was: error marshalling arguments; nested exception is:
java.net.SocketException: Broken pipe
java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.net.SocketException: Broken pipe
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:138)
at net.sf.ehcache.distribution.RMICachePeer_Stub.send(Unknown Source)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.writeReplicationQueue(RMIAsynchronousCacheReplicator.java:314)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.replicationThreadMain(RMIAsynchronousCacheReplicator.java:127)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.access$000(RMIAsynchronousCacheReplicator.java:58)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator$ReplicationThread.run(RMIAsynchronousCacheReplicator.java:389)
Caused by: java.net.SocketException: Broken pipe


Have you had any progress?
jawah

neo

Joined: 11/18/2013 14:25:27
Messages: 2
Offline

Yes I was able to solve the problem.
The problem was with the host files on node1 and node4. They had their ip address mapped to loopback address (127.0.0.1) instead of their actual ip address.

So I removed the entry on node1 and node4 host file and it worked.
Code:
 Remove:
 127.0.0.1 node1.ibm.com.xx node1 localhosthost.localdomain localhost
 
 and replace it with 
 127.0.0.1 localhosthost.localdomain localhost
 
 

loulou

neo

Joined: 09/19/2013 12:15:20
Messages: 4
Offline

Thanks, I'll give it a try.
loulou

neo

Joined: 09/19/2013 12:15:20
Messages: 4
Offline

One more question..

In your ehcache.xml file where you have the RMI cacheManagerPeerListenerFactory and cacheManagerPeerProviderFactory do you also have a cacheEventListenerFactory? If so, what does it look like? I was under the impression that this is supposed to be included but I am not certain if I have this configured correctly.

Thanks
 
Forum Index -> Ehcache
Go to:   
Powered by JForum 2.1.7 © JForum Team