Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

GS XAP 9 - problem with classloading

Dear GigaSpaces Team,

I am new to GS XAP 9 and as a part of learning curve, I am trying to deploy a PU instance that would simply store some objects from an application jar. So far, I have successfully managed to play with write/take, JMS, polling/notify containers on various cluster configurations, but using only simple POJOs. Now, when trying to write more complex objects to the Space (with multiple package dependencies), I get the following errors:

Exception in thread "main" java.lang.NoClassDefFoundError: [this is a "grandparent" class] at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.j_spaces.kernel.ClassLoaderHelper.loadClass(ClassLoaderHelper.java:125) at com.j_spaces.kernel.ClassLoaderHelper.loadClass(ClassLoaderHelper.java:97) at com.gigaspaces.internal.metadata.SpaceTypeInfo.readExternalV80(SpaceTypeInfo.java:1249) at com.gigaspaces.internal.metadata.SpaceTypeInfo.readExternal(SpaceTypeInfo.java:1240) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1810) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at com.gigaspaces.internal.serialization.ObjectClassSerializer.read(ObjectClassSerializer.java:30) at com.gigaspaces.internal.io.IOUtils.readObject(IOUtils.java:715) at com.gigaspaces.internal.metadata.PojoIntrospector.readExternal(PojoIntrospector.java:423) at com.gigaspaces.internal.metadata.AbstractTypeIntrospector.readExternal(AbstractTypeIntrospector.java:353) at com.gigaspaces.internal.metadata.PojoIntrospector.readExternal(PojoIntrospector.java:411) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1810) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at com.gigaspaces.internal.serialization.ObjectClassSerializer.read(ObjectClassSerializer.java:30) at com.gigaspaces.internal.io.IOUtils.readObject(IOUtils.java:715) at com.gigaspaces.internal.metadata.TypeDesc.deserialize(TypeDesc.java:701) at com.gigaspaces.internal.metadata.TypeDesc.readExternal(TypeDesc.java:621) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1810) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at com.gigaspaces.internal.serialization.ObjectClassSerializer.read(ObjectClassSerializer.java:30) at com.gigaspaces.internal.io.IOUtils.readObject(IOUtils.java:715) at com.gigaspaces.internal.transport.AbstractEntryPacket.deserialize(AbstractEntryPacket.java:372) at com.gigaspaces.internal.transport.AbstractEntryPacket.readExternalV80(AbstractEntryPacket.java:356) at com.gigaspaces.internal.transport.AbstractEntryPacket.readExternal(AbstractEntryPacket.java:351) at com.gigaspaces.internal.transport.EntryPacket.readExternal(EntryPacket.java:355) at com.gigaspaces.internal.transport.AbstractEntryPacket.readExternalImpl(AbstractEntryPacket.java:275) at com.gigaspaces.internal.serialization.AbstractExternalizable.readExternal(AbstractExternalizable.java:38) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1810) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at com.gigaspaces.internal.io.IOUtils.unmarshalValue(IOUtils.java:290) at com.gigaspaces.lrmi.nio.RequestPacket.readExternal(RequestPacket.java:210) at com.gigaspaces.lrmi.nio.Reader.unmarshall(Reader.java:539) at com.gigaspaces.lrmi.nio.Reader.unmarshallRequest(Reader.java:470) at com.gigaspaces.lrmi.nio.ChannelEntry.unmarshall(ChannelEntry.java:138) at com.gigaspaces.lrmi.nio.Pivot$ChannelEntryTask.run(Pivot.java:167) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)

Basically, at some point the dependency structure between classes causes this crash. I have double-checked the memory usage, jar files, locations, etc... Also, I tried putting the jars into PU's lib folder, pu-common, platform/ext - no difference. I also made sure that the jar file is not doubled on the classpath. I have really no clue what might be wrong here, except for:

2012-07-24 17:47:30,920 endpointArchiveSimple.1 [2] FINEST [com.gigaspaces.lrmi] - --> Write Packet [RequestPacket: interface com.sun.jini.reggie.Registrar.renewServiceLease(net.jini.core.lookup.ServiceID a74c3e82-6b99-44f2-be82-ef6f5cce0390, net.jini.id.Uuid 53d0183a-f3ba-4b48-bf65-81396b7b6866, long 8000), isOneWay = false, isCallBack = false] 2012-07-24 17:47:30,920 endpointArchiveSimple.1 [2] FINEST [com.gigaspaces.lrmi] - <-- Read packet [ReplyPacket: result = 8000] 2012-07-24 17:47:31,045 endpointArchiveSimple.2 [1] FINER [com.gigaspaces.lrmi] - At CPeer.invoke method, trying to invoke method [IRemoteSpace.ping] [invoker address=/0.0.0.0:1923, ServerEndPoint=NIO://127.0.0.1:1651/pid[9452]/2270333223465503_3_8940856659561854522] 2012-07-24 17:47:31,045 endpointArchiveSimple.2 [1] FINER [com.gigaspaces.lrmi] - At CPeer.invoke method, trying to invoke method [IRemoteSpace.ping] [invoker address=/0.0.0.0:2027, ServerEndPoint=NIO://127.0.0.1:1650/pid[14320]/2270333223501522_4_8009174854675073998] 2012-07-24 17:47:31,045 endpointArchiveSimple.2 [1] FINEST [com.gigaspaces.lrmi] - At CPeer.invoke, thread dump:; Caused by: java.lang.Exception 2012-07-24 17:47:31,045 endpointArchiveSimple.2 [1] FINEST [com.gigaspaces.lrmi] - At CPeer.invoke, thread dump:; Caused by: java.lang.Exception 2012-07-24 17:47:31,045 GSC FINER [com.gigaspaces.lrmi] - ENTRY org.jini.rio.boot.ServiceClassLoader@a8ee09 Name : [endpointArchiveSimple.2 [1]] 2012-07-24 17:47:31,045 GSC FINER [com.gigaspaces.lrmi] - ENTRY org.jini.rio.boot.ServiceClassLoader@a8ee09 Name : [endpointArchiveSimple.2 [1]] 2012-07-24 17:47:31,045 GSC FINER [com.gigaspaces.lrmi] - RETURN 3 2012-07-24 17:47:31,045 GSC FINER [com.gigaspaces.lrmi] - RETURN 3 2012-07-24 17:47:31,045 endpointArchiveSimple.2 [1] FINEST [com.gigaspaces.lrmi] - --> Write Packet [RequestPacket: interface com.gigaspaces.internal.server.space.IRemoteSpace.ping(), isOneWay = false, isCallBack = false] 2012-07-24 17:47:31,045 endpointArchiveSimple.2 [1] FINEST [com.gigaspaces.lrmi] - --> Write Packet [RequestPacket: interface com.gigaspaces.internal.server.space.IRemoteSpace.ping(), isOneWay = false, isCallBack = false] 2012-07-24 17:47:31,045 FINEST [com.gigaspaces.lrmi] - <-- [RequestPacket: interface com.j_spaces.core.admin.IRemoteJSpaceAdmin.ping(), isOneWay = false, isCallBack = false] 2012-07-24 17:47:31,045 FINEST [com.gigaspaces.lrmi] - <-- [RequestPacket: interface com.j_spaces.core.admin.IRemoteJSpaceAdmin.ping(), isOneWay = false, isCallBack = false] 2012-07-24 17:47:31,045 endpointArchiveSimple.2 [1] FINER [com.gigaspaces.lrmi] - ENTRY 2012-07-24 17:47:31,045 endpointArchiveSimple.1 [2] FINER [com.gigaspaces.lrmi] - ENTRY 2012-07-24 17:47:31,045 endpointArchiveSimple.2 [1] FINER [com.gigaspaces.lrmi] - RETURN null 2012-07-24 17:47:31,045 endpointArchiveSimple.1 [2] FINER [com.gigaspaces.lrmi] - RETURN null 2012-07-24 17:47:31,045 endpointArchiveSimple.2 [1] FINEST [com.gigaspaces.lrmi ... (more)

asked 2012-07-25 06:12:06 -0500

robpohnke gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

Robert,
Run the GSC using –verbose:class option and see what’s the class that the JVM trying to load before the NoClassDefFoundError exception is thrown.
Classloading problems usually resolved when placing 3rd party or dependent jars at the \gigaspaces-xap-\lib\platform\ext folder.
Another simpler option would be to set the POST_CLASSPATH variable to include the location of all 3rd party or dependent jars.
Shay

answered 2012-07-25 12:38:02 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-07-25 06:12:06 -0500

Seen: 91 times

Last updated: Jul 25 '12