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

Mitesh,

See below for the full stack trace. Strangely enough, this one's from the receiving side, so the sending instance must have been able to serialize the enum -- which it isn't always. There's a second exception that shows up on the sending side. One of those two is always there.

About the structure of the file I'm deploying:

It's a fairly large ear, containing around 15 jars with our EJBs, some wars, and a lot of dependencies. 6 of the ejb jars contain entity beans and are referenced in persistence.xml, which resides in its own jar (that does not contain any beans itself).

The interface in question, IDocumentList, is in archive.jar, which contains also the DocumentList entity bean that causes the exceptions when changed. DocumentList does not implement IDocumentList but uses the enum ListType defined there.

All of the jars in the ear, including pu.jar (containing persistence.xml) and archive.jar (containing the entity, the interface and the enum) are in the ear's root. The only directory in the ear is META-INF with application.xml in it.

Is there a better place for any of the jars than the ear's root?

Thanks for your assistance!

rv


---

Here are the stack traces:


Receiving node:

[#|2008-12-11T20:01:44.854+0100|WARNING|sun-appserver9.1| org.eclipse.persistence.session.file:/usr/local/server/glassfish/ nodeagents/tas2-agent/tas2-reaktor-test-instance/applications/j2ee- apps/com.bookpac.server/pu.jar-ormpersistence| _ThreadID=38;_ThreadName=RMI TCP Connection (26706)-192.168.23.21;_RequestID=c713f335-a272-41ba-b2bc- e7a139940a30;|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://192.168.23.21:38686]. Internal Exception: java.lang.ClassNotFoundException: com.bookpac.archive.core.IDocumentList$ListType at org.eclipse.persistence.exceptions.CommunicationException.unableToPropag ateChanges(CommunicationException.java:68) at org.eclipse.persistence.sessions.coordination.MergeChangeSetCommand.getC hangeSet(MergeChangeSetCommand.java:47) at org.eclipse.persistence.sessions.coordination.MergeChangeSetCommand.exec uteWithSession(MergeChangeSetCommand.java:82) at org.eclipse.persistence.internal.sessions.AbstractSession.processCommand (AbstractSession.java:3174) at org.eclipse.persistence.sessions.coordination.RemoteCommandManager.proce ssCommandFromRemoteConnection(RemoteCommandManager.java:256) at org.eclipse.persistence.internal.sessions.coordination.rmi.RMIRemoteComm andConnectionImpl.executeCommand(RMIRemoteCommandConnectionImpl.java:52)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch (UnicastServerRef.java:305)
        at sun.rmi.transport.Transport$1.run(Transport.java:159)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages (TCPTransport.java:535) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0 (TCPTransport.java:790) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run (TCPTransport.java:649) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask (ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: com.bookpac.archive.core.IDocumentList$ListType at com.sun.appserv.server.util.ASURLClassLoader.loadClass (ASURLClassLoader.java:129)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java: 319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
at java.io.ObjectInputStream.resolveClass (ObjectInputStream.java:604) at java.io.ObjectInputStream.readNonProxyDesc (ObjectInputStream.java:1575) at java.io.ObjectInputStream.readClassDesc (ObjectInputStream.java:1496) at java.io.ObjectInputStream.readEnum(ObjectInputStream.java: 1686) at java.io.ObjectInputStream.readObject0 (ObjectInputStream.java:1326) at java.io.ObjectInputStream.defaultReadFields (ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData (ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject (ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0 (ObjectInputStream.java:1329) at java.io.ObjectInputStream.readArray (ObjectInputStream.java:1667) at java.io.ObjectInputStream.readObject0 (ObjectInputStream.java:1323) at java.io.ObjectInputStream.defaultReadFields (ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData (ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject (ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0 (ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject (ObjectInputStream.java:351) at org.eclipse.persistence.internal.sessions.ObjectChangeSet.readCompleteCh angeSet(ObjectChangeSet.java:623) at org.eclipse.persistence.internal.sessions.ObjectChangeSet.readObject (ObjectChangeSet.java:660)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject (ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData (ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject (ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0 (ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject (ObjectInputStream.java:351) at java.util.IdentityHashMap.readObject(IdentityHashMap.java: 1188)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject (ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData (ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject (ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0 (ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject (ObjectInputStream.java:351) at org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet.<init> (UnitOfWorkChangeSet.java:69) at org.eclipse.persistence.sessions.coordination.MergeChangeSetCommand.getC hangeSet(MergeChangeSetCommand.java:43)
        ... 18 more
|#]



Sending node:

[#|2008-12-12T11:08:46.336+0100|WARNING|sun-appserver9.1| javax.enterprise.system.stream.err| _ThreadID=41;_ThreadName=Thread-3492;_RequestID=e164d985-5d89-448a-9885- a6d3b4487598;|Local Exception Stack: Exception [EclipseLink-22105] (Eclipse Persistence Services - 1.0.2 (Build 20081024)): org.eclipse.persistence.exceptions.RemoteCommandManagerException Exception Description: Could not propagate command to RemoteConnection [Service[BookpacCacheCoordination, 67bbd4d4-0a0d-47dd-8db8-90d2dac8ac76, rmi://192.168.23.22:38686]] Internal Exception: java.lang.Exception: 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://192.168.23.21:38686]. Internal Exception: java.lang.ClassNotFoundException: com.bookpac.archive.core.IDocumentList$ListType at org.eclipse.persistence.exceptions.RemoteCommandManagerException.unableT oPropagateCommand(RemoteCommandManagerException.java:119) at org.eclipse.persistence.internal.sessions.coordination.CommandPropagator .handleExceptionFromRemoteExecution(CommandPropagator.java:133) at org.eclipse.persistence.internal.sessions.coordination.CommandPropagator .propagateCommand(CommandPropagator.java:113) at org.eclipse.persistence.internal.sessions.coordination.CommandPropagator .run(CommandPropagator.java:187)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.Exception: 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://192.168.23.21:38686]. Internal Exception: java.lang.ClassNotFoundException: com.bookpac.archive.core.IDocumentList$ListType
        ... 4 more
|#]






Am 11.12.2008 um 21:08 schrieb Mitesh Meswani:

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.

Thanks,
Mitesh

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://192.168.23.21:38686]. Internal Exception: java.lang.ClassNotFoundException: com.bookpac.archive.core.IDocumentList$ListType at org.eclipse.persistence.exceptions.CommunicationException.unableToPro pagateChanges(CommunicationException.java:68) at org.eclipse.persistence.sessions.coordination.MergeChangeSetCommand.g etChangeSet(MergeChangeSetCommand.java:47)
[...]
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: com.bookpac.archive.core.IDocumentList$ListType at com.sun.appserv.server.util.ASURLClassLoader.loadClass (ASURLClassLoader.java:129)
[...]


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,

rv


----

This is the code I'm using:

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

rcm.getDiscoveryManager().setMulticastGroupAddress ("226.1.2.3"); //$NON-NLS-1$
        rcm.getDiscoveryManager().setMulticastPort(3122);
        rcm.getDiscoveryManager().setAnnouncementDelay(1000*5);

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

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

        rcm.setServerPlatform(session.getServerPlatform());
        ((DatabaseSession)session).setCommandManager(rcm);
        ((DatabaseSession)session).setShouldPropagateChanges(true);
        rcm.initialize();
    }

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
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top