EHCache replication works only for simple datatypes

Description

For a simple CachePut with Datatypes String and Number, the values are replicated asap to the other instance.
If I put more complex values to the Cache with CachePut (Arry, Struct, Datetime Object) the data was stored in the local Cache, but not replicated to the other caches.

this.cache.connections["test"] = { class: 'org.lucee.extension.cache.eh.EHCache' , bundleName: 'ehcache.extension' , bundleVersion: '2.10.0.25' , storage: false , custom: { "bootstrapAsynchronously":"true", "replicatePuts":"true", "automatic_hostName":"", "bootstrapType":"on", "maxelementsinmemory":"10000", "manual_rmiUrls":"", "distributed":"automatic", "automatic_multicastGroupAddress":"230.0.0.1", "memoryevictionpolicy":"LRU", "replicatePutsViaCopy":"true", "timeToIdleSeconds":"86400", "maximumChunkSizeBytes":"5000000", "automatic_multicastGroupPort":"4446", "listener_socketTimeoutMillis":"120000", "timeToLiveSeconds":"86400", "diskpersistent":"true", "manual_addional":"", "replicateRemovals":"true", "replicateUpdatesViaCopy":"true", "automatic_addional":"", "overflowtodisk":"true", "replicateAsynchronously":"true", "maxelementsondisk":"10000000", "listener_remoteObjectPort":"", "asynchronousReplicationIntervalMillis":"1000", "listener_hostName":"", "replicateUpdates":"true", "manual_hostName":"", "automatic_timeToLive":"unrestricted", "listener_port":"" } , default: 'object' };

Code to reproduce, String and Number ok, other not ok.

<!---- 8888 ----> <cfscript> //cacheClear(); //abort; cachePut("meinString","TestString8888"); //OK cachePut("meineNumer",11111); //cachePut("meinDatum",now()); //cachePut("meinArray",ArrayNew()); //cachePut("meineStruct",StructNew()); dump(CacheGetAll()); </cfscript>

Environment

CentOS in a VirtualBox with Lucee 5.2.4.0 updated with 5.2.4.37 lco file and EHCache Extension Version 2.10.0.25 and OSGi EHCache Implementation Version 2.10.3. Two instances in parallel on same System, ports 8888 and 9999

Activity

Show:

Michael Offner 6 September 2018 at 21:25

Michael Offner 3 September 2018 at 19:14

most likely a fix is not possible , we need to update to EHCache 3 that is OSGi ready to solve this.
Sadly there are big differences between EHCache 2 and 3, there is no caching configuration on object level anymore.
So an update without breaking compatibility is not possible.

Alexander Diedler 15 March 2018 at 09:13

Hello,
Could you push these issue to one of the next sprints? We used EHCache since Railo exists and with the EOL for Railo and starting with Lucee, the problems starts also for us and the customers. We hanging with a cluster project now for more than one year because we cannot finish the cluster setup in case of missing issue like this.

Michael Offner 6 November 2017 at 19:00

that is what is happening, the thread created by RMI does not use our classloader.

"ERROR","Replication Thread","11/06/2017","19:52:25","ehcache","Unable to send message to remote peer. Message was: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: lucee.runtime.type.ArrayImpl (no security manager: RMI class loader disabled);RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: lucee.runtime.type.ArrayImpl (no security manager: RMI class loader disabled);java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: lucee.runtime.type.ArrayImpl (no security manager: RMI class loader disabled) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:354) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$240(TCPTransport.java:683) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$2/1851389190.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162) at net.sf.ehcache.distribution.RMICachePeer_Stub.send(Unknown Source) at org.lucee.extension.cache.eh.rmi.LuceeRMIAsynchronousCacheReplicator.writeReplicationQueue(LuceeRMIAsynchronousCacheReplicator.java:313) at org.lucee.extension.cache.eh.rmi.LuceeRMIAsynchronousCacheReplicator.replicationThreadMain(LuceeRMIAsynchronousCacheReplicator.java:126) at org.lucee.extension.cache.eh.rmi.LuceeRMIAsynchronousCacheReplicator.access$000(LuceeRMIAsynchronousCacheReplicator.java:46) at org.lucee.extension.cache.eh.rmi.LuceeRMIAsynchronousCacheReplicator$ReplicationThread.run(LuceeRMIAsynchronousCacheReplicator.java:413) Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: lucee.runtime.type.ArrayImpl (no security manager: RMI class loader disabled) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:314) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$240(TCPTransport.java:683) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$2/1851389190.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ClassNotFoundException: lucee.runtime.type.ArrayImpl (no security manager: RMI class loader disabled) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:396) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:186) at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637) at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264) at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:214) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:501) at net.sf.ehcache.Element.readObject(Element.java:884) at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371) at java.util.ArrayList.readObject(ArrayList.java:791) at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371) at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:326) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:308) ... 13 more "

Alexander Diedler 6 November 2017 at 11:18

Thank you to confirm. I have no idea how to write a UnitTest for that, because it was only reproducable with Cluster. Is there a Chance to have a fix this week for a quick implementation.

Fixed

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 3 November 2017 at 09:59
Updated 8 May 2020 at 19:23
Resolved 6 September 2018 at 21:45