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

Ask Your Question
0

IllegalArgumentException when a worker takes from a space

Hello,

We're prototyping a basic application which involves a client application adding an Entry to a space which is taken out and acted upon by a worker (service).

The exception is: {code} SEVERE: Error - Transaction is being aborted 15730605 net.jini.core.entry.UnusableEntryException at com.j_spaces.core.client.JSpaceProxyUtil.getEntry(SourceFile:768) at com.j_spaces.core.client.JSpaceProxyUtil.getEntry(SourceFile:811) at com.j_spaces.core.client.JSpaceProxyUtil.getEntry(SourceFile:795) at com.j_spaces.core.client.single.action.AbstractSingleSpaceReadTakeAct ionListener.read(SourceFile:252) at com.j_spaces.core.client.single.action.SingleSpaceTakeActionListener. onAction(SourceFile:37) at com.j_spaces.core.client.single.action.SingleSpaceTakeActionListener. onAction(SourceFile:15) at com.j_spaces.core.client.AbstractSpaceProxy.take(SourceFile:253) at com.j_spaces.core.client.AbstractSpaceProxy.take(SourceFile:224) at com.....RequestHandlerImpl.doWork(Re questHandlerImpl.java:60) at com.....RequestHandlerImpl$ThreadWor ker.run(RequestHandlerImpl.java:122) Total unmarshalling failure, cause was: java.lang.IllegalArgumentException at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccess orImpl.java:63) at java.lang.reflect.Field.set(Field.java:519) at com.j_spaces.core.client.JSpaceProxyUtil.getEntry(SourceFile:684) at com.j_spaces.core.client.JSpaceProxyUtil.getEntry(SourceFile:811) at com.j_spaces.core.client.JSpaceProxyUtil.getEntry(SourceFile:795) at com.j_spaces.core.client.single.action.AbstractSingleSpaceReadTakeAct ionListener.read(SourceFile:252) at com.j_spaces.core.client.single.action.SingleSpaceTakeActionListener. onAction(SourceFile:37) at com.j_spaces.core.client.single.action.SingleSpaceTakeActionListener. onAction(SourceFile:15) at com.j_spaces.core.client.AbstractSpaceProxy.take(SourceFile:253) at com.j_spaces.core.client.AbstractSpaceProxy.take(SourceFile:224) at com.....RequestHandlerImpl.doWork(Re questHandlerImpl.java:60) at com.....RequestHandlerImpl$ThreadWor ker.run(RequestHandlerImpl.java:122) Jul 9, 2007 1:23:45 PM com.....RequestHandlerIm pl doWork {code}

and the Entry is:

{code} public class Request implements Entry, Serializable { public RequestDescriptor requestDescriptor; public String id;

public Request() {
}

public void setId(String id) {
    this.id = id;
}

public String getId() {
    return id;
}


public RequestDescriptor getRequestDescriptor() {
    return requestDescriptor;
}

public void setRequestDescriptor(RequestDescriptor requestDescriptor) {
    this.requestDescriptor = requestDescriptor;
}

} {code}

If we remove the RequestDescriptor member, which is a simple serializable pojo, the take works fine.

Thanks for any assistance.

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

asked 2007-07-09 15:05:02 -0500

mmorowitz 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

Can you have the RequestDescriptor class as part of the Space CLASSPATH and retry?

Please note you should not have the Request class to implement the Serializable interface. The Entry interface extends the Serializable interface.

Make sure the RequestDescriptor class implement the Serializable interface.

When your class implements the Entry interface it is not treated as POJO - i.e. the getter and setter methods are ignored.

Shay

answered 2007-07-09 15:13:05 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Comments

[quote=Shay Hassidim]Can you have the RequestDescriptor class as part of the Space CLASSPATH and retry?

Please note you should not have the Request class to implement the Serializable interface. The Entry interface extends the Serializable interface.

Make sure the RequestDescriptor class implement the Serializable interface.

When your class implements the Entry interface it is not treated as POJO - i.e. the getter and setter methods are ignored.

Shay {quote}

Thanks. The RequestDescriptor is already in the classpath. It is in the same JAR as the Request class.

mmorowitz gravatar imagemmorowitz ( 2007-07-09 15:16:03 -0500 )edit

Another key thing to point out is that the space is not having any problem. The Entry can be written to the space and it is taken out of the space. The error occurs from the Service that is trying to read the Entry once it has taken it.

mmorowitz gravatar imagemmorowitz ( 2007-07-09 15:36:05 -0500 )edit

Are you using the Service Grid to deploy your services? It sounds you need to define a shared compoenent element as part of deployment descriptor that will include a jar with your entry class and the RequestDescriptor class. See: http://www.gigaspaces.com/wiki/displa...

Shay

shay hassidim gravatar imageshay hassidim ( 2007-07-09 23:31:02 -0500 )edit

[quote=Shay Hassidim]Are you using the Service Grid to deploy your services? It sounds you need to define a shared compoenent element as part of deployment descriptor that will include a jar with your entry class and the RequestDescriptor class. See: http://www.gigaspaces.com/wiki/displa...

Shay {quote}

Thanks. The problem did turn out to be a problem with the <sharedcomponent> element in our service deployment descriptor.

Originally we simply had a list of jars nested inside the <implementation> of our service. Once we wrapped these jars in a <sharedcomponent> and added a <classname> element, everything worked as expected.

mmorowitz gravatar imagemmorowitz ( 2007-07-16 11:03:03 -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

Stats

Asked: 2007-07-09 15:05:02 -0500

Seen: 46 times

Last updated: Jul 09 '07