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

Ask Your Question
0

read calls exception but take is fine

I am trying to implement read through pattern and everything seems straightforward and works fine for take operation BUT after client reads entry through local(near cache) the following error is thrown:

Mar 13, 2008 10:04:31 PM FINE [com.gigaspaces.core.engine]: New Type Table Entry Has Just Registered : com.cobaltgroup.inventory.referencedata.vo.ReferenceStyle

Mar 13, 2008 10:04:31 PM FINE [com.gigaspaces.core.engine]: Update Type Table Entry : com.cobaltgroup.inventory.referencedata.vo.ReferenceStyle

java.rmi.RemoteException: fail while caching; nested exception is: java.lang.IllegalArgumentException: UID or VersionID not supplied for write operation in local-cache mode. at com.j_spaces.core.client.DCacheSpaceImpl.cache(SourceFile:687) at com.j_spaces.core.client.dcache.action.AbstractDCacheSpaceReadTakeActionListener.read(SourceFile:98) at com.j_spaces.core.client.dcache.action.DCacheSpaceReadActionListener.onAction(SourceFile:15) at com.j_spaces.core.client.dcache.action.DCacheSpaceReadActionListener.onAction(SourceFile:9) at com.j_spaces.core.client.AbstractSpaceProxy.read(SourceFile:167) at com.j_spaces.core.client.AbstractSpaceProxy.read(SourceFile:150) at cblt.inventory.service.client.InvClient.read(InvClient.java:51) at cblt.inventory.service.client.InvClient.main(InvClient.java:40) Caused by: java.lang.IllegalArgumentException: UID or VersionID not supplied for write operation in local-cache mode. at com.j_spaces.obf.ko.a(SourceFile:1020) at com.j_spaces.obf.ko.a(SourceFile:968) at com.j_spaces.obf.ko.a(SourceFile:950) at com.j_spaces.core.JSpaceImpl.a(SourceFile:1668) at com.j_spaces.core.JSpaceImpl.update(SourceFile:1566) at com.j_spaces.core.lrmi.LRMIRemoteSpaceImpl.update(SourceFile:253) at com.j_spaces.core.client.single.action.AbstractSingleSpaceUpdateActionListener.internalUpdate(SourceFile:100) at com.j_spaces.core.client.single.action.AbstractSingleSpaceUpdateActionListener.update(SourceFile:52) at com.j_spaces.core.client.single.action.SingleSpaceUpdateActionListener.onAction(SourceFile:15) at com.j_spaces.core.client.single.action.SingleSpaceUpdateActionListener.onAction(SourceFile:9) at com.j_spaces.core.client.AbstractSpaceProxy.update(SourceFile:487) at com.j_spaces.core.client.AbstractSpaceProxy.update(SourceFile:476) at com.j_spaces.core.client.DCacheSpaceImpl.cache(SourceFile:669) ... 7 more

What I am doing wrong? On the server side it seems that the necessary object was found just fine InventoryDataSource.iterator Mar 13, 2008 10:04:31 PM Class: com.j_spaces.obf.de Method: DataProvider#iterator FINER [com.gigaspaces.persistent]: RETURN cblt.inventory.service.space.InventoryDataSource$DataIteratorImpl@84336b

Mar 13, 2008 10:04:31 PM Class: com.j_spaces.obf.fb Method: E FINER [com.gigaspaces.persistent]: CacheIterator#next() RETURNs IGSEntry<com.cobaltgroup.inventory.referencedata.vo.referencestyle, uid:="" -1170499039^57^zz^0^0,="" fields:="" chromehiststyleid:="" name-1205471071658,="" chromestyle:="" com.cobaltgroup.inventory.referencedata.chrome.vo.chromestyle@4bdc05,="" cobaltstyleid:="" zz,="" ><="" p="">

The client looks like this: public class InvClient {

IJSpace space;

public InvClient() throws FinderException {
    Object s = SpaceFinder.find("jini://*/*/gigainv?useLocalCache&updateMode=1");
    //Object s = SpaceFinder.find("jini://*/*/gigainv");
    space =(IJSpace) s;
    System.out.println("space = " + space);
}



public static void main(String[] args) {
    try {
        InvClient c = new InvClient();
        ReferenceStyle p = new ReferenceStyle();
        p.setCobaltStyleId("ZZ");
        ReferenceStyle o = (ReferenceStyle) c.read(p);
        System.out.println("Read::" + o.getChromeStyle().getBodyStyles());

    } catch (Exception e) {
        e.printStackTrace(); 
    }

}

private Object read(Object a) throws RemoteException, UnusableEntryException, TransactionException, InterruptedException {

    return space.read( a, null, Long.MAX_VALUE);
}

}

Again - if I call take and not read operation then everything is fine... it is quite confusing.

If need more information please look into the attached source files.

Thanks!

Oh, the version is GigaSpacesEDG6.0-1.4build running on 1.4 Java on OS X

Edited by: kgignatyev on Mar 14, 2008 1:13 AM h4. Attachments

[src.tgz|/upfiles/13759720845198865.gz]

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

asked 2008-03-14 00:12:45 -0500

kgignatyev 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

This should work with 6.0.3. Shay

answered 2008-03-14 06:44:29 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Unfortunately it does not work in 6.0.3 - I just (re)downloaded the 6.0.3 run the examples from ant to avoid any IDE influence and still the exception happens.
Full log on the space node is below:

administrators-macbook:giga_inventory admin$ ant run-space
Buildfile: build.xml
Duplicated project name in import. Project gigainventory defined first in /Users/admin/dev/cblt/Playpen/ignatyev/gigainventory/build.xml and again in /Users/admin/dev/cblt/Playpen/ignatyev/gigainventory/gigainventory.xml

run-space:
     java CONFIG: Sets the system property ${com.gs.home} with value: /Users/admin/java/app/GigaSpacesEDG6.0-1.4build/
     java Mar 14, 2008 9:21:06 AM
java INFO com.gigaspaces.container:

java System Environment:
     java System:
     java OS Version: 10.5.2
     java Architecture: i386
     java OS Name: Mac OS X
     java Number Of Processors: 2
     java J2SE Support:
     java VM Vendor: Apple Inc.
     java Using Java Home: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home
     java Java(TM) 2 Runtime Environment, Standard Edition
     java Java HotSpot(TM) Client VM (build 1.4.2-85 )
     java JVM Memory:
     java Max Heap Size (KB): 163840
     java Current Allocated Heap Size (KB): 812
     java Network Interfaces Information:
     java Host Name: sea-rfiguly.main.cobaltgroup.com
     java Network Interface Name: vmnet1 / vmnet1
     java IP Address: 172.16.98.1
     java Network Interface Name: vmnet8 / vmnet8
     java IP Address: 172.16.247.1
     java Network Interface Name: en0 / en0
     java IP Address: 192.168.20.113
     java IP Address: fe80:0:0:0:21b:63ff:fea6:55dc
     java Network Interface Name: lo0 / lo0
     java IP Address: 127.0.0.1
     java IP Address: 0:0:0:0:0:0:0:1
     java IP Address: fe80:0:0:0:0:0:0:1
     java GigaSpaces Platform:
     java Edition: 6.0 EDG
java Build: 2040

java Mar 14, 2008 9:21:06 AM
java INFO com.gigaspaces.container: Created RMIRegistry on: < 192.168.20.113:10098 >

java Mar 14, 2008 9:21:06 AM
     java INFO com.gigaspaces.container: Webster HTTP server started successfully serving the following roots: /Users/admin/java/app/GigaSpacesEDG6.0-1.4build//lib;/Users/admin/java/app/GigaSpacesEDG6.0-1.4build//lib/jini
java Webster serving on: 192.168.20.113:9813

java Mar 14, 2008 9:21:06 AM
java INFO com.gigaspaces.container: Space is using -Djava.rmi.server.codebase=http://192.168.20.113:9813/JSpaces.jarhttp://192.168.20.113:9813/jsk-dl.jarhttp://192.168.20.113:9813/reggie-dl.jar

java Mar 14, 2008 9:21:06 AM
java INFO com.gigaspaces.container: Starting Embedded Jini Lookup Service using the following Codebase: http://192.168.20.113:9813/reggie-dl.jarhttp://192.168.20.113:9813/jsk-dl.jar

java Mar 14, 2008 9:21:06 AM
java INFO com.gigaspaces.container: Started an embedded Jini Lookup Service

java Mar 14, 2008 9:21:06 AM
java INFO com.gigaspaces.core.lookupmanager:

java Directory Service (RMI Registry):
     javacontainer> container bound successfully to RMIRegistry. "> <gigainv ...
(more)

kgignatyev gravatar imagekgignatyev ( 2008-03-14 11:25:09 -0500 )edit

and if I change read to take and change the requested id, recompile client and rerun it against the same continuously running cloud node everything is fine:

[java] Mar 14, 2008 9:33:03 AM [java] FINE [com.gigaspaces.core.engine]: Bus packet arrived : com.j_spaces.obf.hg

 [java] Mar 14, 2008 9:33:04 AM Class: com.j_spaces.obf.de Method: DataProvider#iterator
 [java] FINER [com.gigaspaces.persistent]: ENTRY com.cobaltgroup.inventory.referencedata.vo.ReferenceStyle@5cc63a

 [java] Mar 14, 2008 9:33:04 AM Class: com.j_spaces.obf.de Method: DataProvider#iterator
 [java] FINER [com.gigaspaces.persistent]: RETURN cblt.inventory.service.space.InventoryDataSource$DataIteratorImpl@da2096

 [java] Mar 14, 2008 9:33:04 AM Class: com.j_spaces.obf.fb Method: E
 [java] InventoryDataSource.iterator
 [java] InventoryDataSource.remove::com.cobaltgroup.inventory.referencedata.vo.ReferenceStyle@ce3c61
 [java] FINER [com.gigaspaces.persistent]: CacheIterator#next() RETURNs IGSEntry<com.cobaltgroup.inventory.referencedata.vo.ReferenceStyle, UID: -1170499039^57^SS^0^0, Fields: chromeHistStyleId: name-1205512384063, chromeStyle: com.cobaltgroup.inventory.referencedata.chrome.vo.ChromeStyle@9198ea, cobaltStyleId: SS, >

 [java] Mar 14, 2008 9:33:04 AM Class: com.j_spaces.obf.de Method: DataPersister#remove
 [java] FINER [com.gigaspaces.persistent]: ENTRY com.cobaltgroup.inventory.referencedata.vo.ReferenceStyle@ce3c61

 [java] Mar 14, 2008 9:33:04 AM
 [java] FINE [com.gigaspaces.core.engine]: Update Type Table Entry  : com.j_spaces.map.Command

 [java] Mar 14, 2008 9:33:04 AM
 [java] FINE [com.gigaspaces.core.engine]: Update Type Table Entry  : com.j_spaces.map.Command

 [java] Mar 14, 2008 9:33:04 AM
 [java] FINE [com.gigaspaces.core.engine]: Bus packet arrived  : com.j_spaces.obf.ih

===============

and the client reports: [java] space = gigainv_DCache-ID27776309^7^E^1205511667238^17 [java] Read::[Lcom.cobaltgroup.inventory.referencedata.chrome.vo.ChromeBodyStyle;@a7ed8f

kgignatyev gravatar imagekgignatyev ( 2008-03-14 11:37:00 -0500 )edit

Your ReferenceStyle.gs.xml got this:
 <class name="com.cobaltgroup.inventory.referencedata.vo.ReferenceStyle" persist="true" replicate="true" fifo="true">
  <property name="chromeStyle" index="none" />
  <property name="chromeHistStyleId" index="none" />
  <id name="cobaltStyleId" auto-generate="false" />
  </class>
</gigaspaces-mapping>

You should add the version tag and add relevant version field into your POJO. See:
http://www.gigaspaces.com/wiki/display/GS6/POJOClassandFieldLevelAnnotations-6.0
http://www.gigaspaces.com/wiki/display/GS6/OptimisticLocking-6.0 - See POJO Based Class

It should be something like this:
 <class name="com.cobaltgroup.inventory.referencedata.vo.ReferenceStyle" persist="true" replicate="true" fifo="true">
  <property name="chromeStyle" index="none" />
  <property name="chromeHistStyleId" index="none" />
  <property name="versionID" index="none" />
  <id name="cobaltStyleId" auto-generate="false" />
  <version name="versionID" />
  </class>
</gigaspaces-mapping>

I guess do not think you need fifo="true". I suggest you to remove this. It is an overhead you don't need in your case.

Shay

shay hassidim gravatar imageshay hassidim ( 2008-03-14 11:43:34 -0500 )edit

Nope, version does not help.

kgignatyev gravatar imagekgignatyev ( 2008-03-14 11:57:23 -0500 )edit

does the version field has a value when loaded into the space or is it null?

shay hassidim gravatar imageshay hassidim ( 2008-03-14 12:11:06 -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: 2008-03-14 00:12:45 -0500

Seen: 89 times

Last updated: Mar 14 '08