Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Cache Coordination in Glassfish

Can you please describe the structure of archive that you deploy in more details. Specially how is the jar that contains entities and the enum placed? Also can you please post full exception stack trace for the exceptions below.


wintermute@xxxxxxxxxxxxxxxxxx wrote:
Hi list,

it's been quite a while -- some of you may remember I was trying to get EclipseLink cache coordination to work in Glassfish.

The good news is: When I got back to this, I did it. I'll attach the piece of code that does the trick.
The bad news: There's one more issue.

Most of my changes propagate to the cluster, but as soon as a particular entity is involved, I see exceptions in the log. The only thing special about the entity is that it uses an enum constant defined in an Interface elswhere, but certainly in the reach of the application classloader. Here's the exception:

MergeChangeSetCommand command failed due to: Local Exception Stack:
Exception [EclipseLink-12002] (Eclipse Persistence Services - 1.0.2 (Build 20081024)): org.eclipse.persistence.exceptions.CommunicationException Exception Description: Unable to propagate changes to Service[BookpacCacheCoordination, 8f4d39c0-d1bb-4530-8c54-a5b3542d68ff, rmi://]. Internal Exception: java.lang.ClassNotFoundException: com.bookpac.archive.core.IDocumentList$ListType at org.eclipse.persistence.exceptions.CommunicationException.unableToPropagateChanges( at org.eclipse.persistence.sessions.coordination.MergeChangeSetCommand.getChangeSet(
Caused by: java.lang.ClassNotFoundException: com.bookpac.archive.core.IDocumentList$ListType at com.sun.appserv.server.util.ASURLClassLoader.loadClass(

ListType is an enum, defined in IDocumentList. It's there, and the class is in a jar known to persistence.xml, in fact, in the same jar as the other entities that do get propagated.

Is there a general problem with enums? Or do they need to be defined in the JPA entity that uses them?

Maybe someone knows something about this Classloading thing with Enums?

Thanks in advance,



This is the code I'm using:

    public void customize(Session session) throws Exception {
RemoteCommandManager rcm = new RemoteCommandManager((CommandProcessor)session);

rcm.getDiscoveryManager().setMulticastGroupAddress(""); //$NON-NLS-1$

        rcm.setChannel("CacheCoordination"); //$NON-NLS-1$

        rcm.getTransportManager().setUserName("admin"); //$NON-NLS-1$
rcm.getTransportManager().setPassword("adminadmin"); //$NON-NLS-1$
        rcm.setUrl("rmi://$HOST:38686"); //$NON-NLS-1$


This is the customize Method of an EclipseLink session customizer, obviously. The important bit is the rcm.setUrl(...) line -- 38686 is the port you want to be using for RMI in Glassfish clusters.

One thing that hat confused me was the announcement delay: I thougt announcement would be done periodically, but it's not. Nodes announce excactly once by default, when they start up. So there's a chance of nodes missing each other if one of them is starting up slowly and doesn't hear the other's announcements. The announcement delay should be larger than the maximum difference between startup times of the nodes -- unfortunately, there's no way of knowing this. To make sure I don't end up with a slow node that doesn't have its cache updated without me noticing in production, I added some more announcements.

eclipselink-users mailing list

Back to the top