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

Ask Your Question

Task Implementation Rejeced by Server


I am trying to implement an executor task using 7.0.0 M4 and I am running into trouble when my Task object (flow.DiceTask - source attached) reaches the server. The exception output from GSC seems to vary, but here are excerpts showing the kinds of messages I am getting:


SEVERE [com.gigaspaces.lrmi]: LRMI Transport Protocol caught ser ver exception caused by [/] client. java.lang.ClassCastException: flow.DiceTask cannot be cast to or g.openspaces.core.executor.Task


SEVERE [com.gigaspaces.lrmi]: LRMI Transport Protocol caught server exception caused by [/192. com.gigaspaces.lrmi.nio.UnMarshallingException: Failed to unmarsh :[RequestPacket: interface c or.SpaceTask null, net.jini.core.transaction.Transaction null, com.j_spaces.core.SpaceContext at com.gigaspaces.lrmi.nio.Reader.unmarshall(Reader.java:453) . . . at java.lang.Thread.run(Unknown Source) Caused by: java.io.InvalidClassException: flow.DiceTask; local class incompatible: stream clas erialVersionUID = -7723226931243160328 at java.io.ObjectStreamClass.initNonProxy(Unknown Source)

I would appreciate any advice on how to resolve this.



Edited by: Dan Stone on Apr 21, 2009 5:06 AM

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3022]{quote}

asked 2009-04-21 04:59:59 -0500

subuta 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

Hi Dan

This is related to a known class loading issue that will be resolved in
the next milestone.
In the mean time the workaround is to put the Task class definition in
the server classpath as well.


answered 2009-04-21 05:35:00 -0500

uri gravatar image
edit flag offensive delete link more


Hi Uri,

Thanks for the quick response. What is the cleanest way to modify the server classpath? I hate to make any changes to the distribution.


subuta gravatar imagesubuta ( 2009-04-21 05:44:52 -0500 )edit

If you have a server side processing unit you can put it in its lib directory. Otherwise, in m4 you can throw it under /lib/ext. In the next milestone, due to major classloading improvements, this will be under GSHOME/lib/optional/pu-common (note that the lib directory structure changed in m6 as documented here: http://www.gigaspaces.com/wiki/displa... ).


uri gravatar imageuri ( 2009-04-21 07:50:00 -0500 )edit

Hi Uri,

Thanks for this info. Somehow though I am still missing something.

I put the class file into that directory, cycled the GSM and GSC, launched my space, and got the same behavior.

Next I jarred the class file, cycled the GSM and GSC, launched my space, and still got the same behavior.

dan@scapps1:~$ ls -ltr /usr/local/gigaspaces/lib/ext/ total 8 -rw-r--r-- 1 dan dan 2393 2009-04-21 15:02 DiceTask.class -rw-r--r-- 1 dan dan 345 2009-04-21 15:02 dice.jar dan@scapps1:~$

21-Apr-2009 15:03:24 SEVERE [com.gigaspaces.lrmi]: LRMI Transport Protocol caught server exception caused by [/] client. java.lang.ClassCastException: flow.DiceTask cannot be cast to org.openspaces.core.executor.Task at org.openspaces.core.executor.internal.InternalSpaceTaskWrappe

Any additional suggestions?


subuta gravatar imagesubuta ( 2009-04-21 09:16:00 -0500 )edit

Hi Dan

Where did you place the original classes in the client application?

uri gravatar imageuri ( 2009-04-21 09:22:00 -0500 )edit

Hi Uri,

I I understand your question correctly you are asking about the classpath for the client application that sends the tasks to the spaces. I invoke the client like this:

java -classpath bin:bin/gs:./lib/JSpaces.jar:./lib/spring/spring.jar:./lib/openspaces/openspaces.jar:./lib/common/commons-logging.jar flow/ClientNoThreeGS ./dice.properties

The task we are talking about is in bin/gs/flow:

dan@scapps1:~/dice$ ls bin/gs/flow/ CheckerGS.class CounterTester.class InitializerGS.class ClientFirstTwoGS.class DiceTask.class SharedIntVar.class ClientNoThreeGS.class GoFlag.class SpaceInit.class ClientSimpleGS.class IncrementerGeneratorGS.class Starter.class dan@scapps1:~/dice$

I have inserted a line to print a diagnostic message in the DiceTask constructor:

public DiceTask(Incrementer i) {
    this.i = i;
System.out.println("\nGot made: " + i.toString());


and I see the diagnostic message displayed in the client's xterm:

Routing to: 247

Yee Haw: id: 24 counterId: 186 lengthOfUselessWorkCycle: 0 processed: false

Got made: id: 24 counterId: 186 lengthOfUselessWorkCycle: 0 processed: false

Routing to: 186


subuta gravatar imagesubuta ( 2009-04-21 09:33:00 -0500 )edit

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


Asked: 2009-04-21 04:59:59 -0500

Seen: 51 times

Last updated: Apr 21 '09