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

Ask Your Question
0

Invoking space.update on POJOs without using SpaceId

I am using XAP 7.1.1

I create a Space and populate it with objects with no SpaceId property declared. So I see that the space generates a space id (UID) for the object and writes it.

Writes and reads are all fine, but when I try to update an object, am getting this exception:

SEVERE: Failed to invoke one-way method: public abstract com.j_spaces.core.AnswerPacket com.gigaspaces.internal.server.space.IRemoteSpace.update(com.gigaspaces.internal.transport.IEntryPacket,net.jini.core.transaction.Transaction,long,long,com.j_spaces.core.client.IJSpaceProxyListener,com.j_spaces.core.SpaceContext,boolean,int) throws net.jini.core.transaction.TransactionException,net.jini.core.entry.UnusableEntryException,com.j_spaces.core.UnknownTypeException,java.rmi.RemoteException,java.lang.InterruptedException com.gigaspaces.exception.lrmi.ApplicationException Caused by: com.j_spaces.core.DetailedUnusableEntryException: Update operation requires non-null object UID. Object=(class=com.avaya.common.SimpleSpaceEntry,uid=null,version=1) at com.gigaspaces.internal.server.space.SpaceEngine.update(SpaceEngine.java:2098) at com.gigaspaces.internal.server.space.SpaceEngine.update(SpaceEngine.java:2017)

What am I missing here?

Thanks! Abhishek

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

asked 2011-08-19 07:31:53 -0500

rogerabhi 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

Your POJO class should have SpaceId annotation preferably using the autoGenerate=false: {code} private Integer id; @SpaceId(autoGenerate=false) public Integer getId() { return id;}

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

Shay

Edited by: Shay Hassidim on Aug 19, 2011 7:41 AM

answered 2011-08-19 07:41:11 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Hi Shay,

I am facing the same issue, where update on my POJO is failing. The entry I am trying to update is a POJO with @SpaceId annotation as you mentioned.

... private String id; // this field will act as UID in the space

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

@SpaceId(autoGenerate = false)
public String getId() {
    return id;
}

....

Write operation is successful. Read operation is successful and I am also able to print the 'id' just before calling update. Are there any settings or GS related System properties that affect the 'update' operation?

Regards, Vinuta

Exception stack shows the following error:

2012-01-13 15:04:56,931 ERROR (DebugLogger_Log4jImpl.java:239) - (DataGrid.java:1927) DataGrid update caught Unexpected Exception caught org.openspaces.core.UnusableEntryException: Update operation requires non-null object UID. Object=(class=com.avaya.aie.presence.types.CacheAttributeData,uid=null,version=0); nested exception is com.j_spaces.core.DetailedUnusableEntryException: Update operation requires non-null object UID. Object=(class=com.avaya.aie.presence.types.CacheAttributeData,uid=null,version=0) at org.openspaces.core.exception.DefaultExceptionTranslator.internalTranslate(DefaultExceptionTranslator.java:164) at org.openspaces.core.exception.DefaultExceptionTranslator.internalTranslate(DefaultExceptionTranslator.java:103) at org.openspaces.core.exception.DefaultExceptionTranslator.translate(DefaultExceptionTranslator.java:50) at org.openspaces.core.DefaultGigaSpace.write(DefaultGigaSpace.java:638) at com.nortel.appcore.common.datagrid.server.DataGrid.gigaSpaceUpdate(DataGrid.java:1917) at com.nortel.appcore.common.datagrid.server.DataGrid.gigaSpaceUpdate(DataGrid.java:1870) at com.avaya.aie.presence.PresenceBean.cacheSetPresence(PresenceBean.java:1441) at com.avaya.aie.presence.PresenceBean.statusChanged(PresenceBean.java:613) at com.avaya.aie.presence.ACTCallbackThreadTransfer$1statusChanged.run(ACTCallbackThreadTransfer.java:212) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919) at java.lang.Thread.run(Thread.java:737) Caused by: com.j_spaces.core.DetailedUnusableEntryException: Update operation requires non-null object UID. Object=(class=com.avaya.aie.presence.types.CacheAttributeData,uid=null,version=0) at com.gigaspaces.internal.server.space.SpaceEngine.update(SpaceEngine.java:2098) at com.gigaspaces.internal.server.space.SpaceEngine.update(SpaceEngine.java:2017) at com.gigaspaces.internal.server.space.SpaceEngine.update(SpaceEngine.java:1998) at com.gigaspaces.internal.server.space.SpaceImpl.update(SpaceImpl.java:1693) at com.gigaspaces.internal.lrmi.stubs.LRMISpaceImpl.update(LRMISpaceImpl.java:297) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplWriteUpdateAction.internalUpdateOrWrite(SpaceProxyImplWriteUpdateAction.java:223) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplWriteUpdateAction.updateOrWrite(SpaceProxyImplWriteUpdateAction.java:183) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplWriteUpdateAction.access$000(SpaceProxyImplWriteUpdateAction.java:32) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplWriteUpdateAction$ClusterSpaceWriteProxyAction.write(SpaceProxyImplWriteUpdateAction.java:52) at com.gigaspaces.internal.client.spaceproxy.actions.AbstractSpaceProxyActionManager.write(AbstractSpaceProxyActionManager.java:463) at com.gigaspaces.internal.client.spaceproxy.AbstractSpaceProxy.write(AbstractSpaceProxy.java:420) at org.openspaces.core.DefaultGigaSpace.write(DefaultGigaSpace.java:636) ... 8 more Caused by: java.lang.Throwable: Update operation requires non-null object UID. Object=(class=com.avaya.aie.presence.types.CacheAttributeData,uid=null,version=0) at com.j_spaces.core.DetailedUnusableEntryException.<init>(DetailedUnusableEntryException.java:32) ... 20 more

vinuta gravatar imagevinuta ( 2012-01-13 03:48:21 -0500 )edit

Can you please post the code that write/update and the space class?
Something is missing.
Tnx
Shay

shay hassidim gravatar imageshay hassidim ( 2012-01-13 08:39:42 -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: 2011-08-19 07:31:53 -0500

Seen: 97 times

Last updated: Aug 19 '11