[jbosscache-dev] Fixing PojoCache tutorial - exception from getState

Galder Zamarreno galder.zamarreno at redhat.com
Tue Apr 24 17:45:11 EDT 2007


Hi,

I'm trying to fix the tutorial for PojoCache. This works slightly 
different because you have an instance of the GUI and then the code 
entered via ./runShellDemo.sh

I have noted that in JBossCacheView, there following happens before 
starting the cache:

// hack to prevent a state transfer for now
cache.getConfiguration().setFetchInMemoryState(false);

pojocache.bsh which is loaded via ./runShellDemo.sh still uses the same 
replSynch-service.xml descriptor but it does not set fetch in memory to 
false.

So, if you start the GUI first, and then execute ./runShellDemo.sh and 
then type sourceRelative("pojocache.bsh");, you get an exception like this:

"Caused by: org.jboss.cache.CacheException: Cache instance at 
127.0.0.1:33058 cannot integrate state since state provider could not 
provide state due to org.jboss.cache.CacheException: Cache instance at 
127.0.0.1:33056 is not configured to provide state"

Now, i'm debating the suitability of the following code in 
StateTransferManager.getState:

if (!fetchPersistentState && !fetchTransientState)
{
e = new CacheException("Cache instance at " + cache.getLocalAddress() + 
" is not configured to provide state");
}

Documentation says: "FetchInMemoryState: Whether or not to acquire the 
initial in-memory state from existing members. "

It does not say anything about giving a state. There's nothing saying 
that a cache not configured to fetch should not be able to give it. I 
mean, a cache could potentially be configured not to retrieve transient 
state on startup, but another cache could be configured to do so and 
should be able to retrieve it from the first cache started, shouldn't it?

Cheers,

-- 
Galder Zamarreño
Sr. Software Maintenance Engineer
JBoss, a division of Red Hat



More information about the jbosscache-dev mailing list