[jboss-jira] [JBoss JIRA] Created: (JBCACHE-1213) Exception thrown when connecting to a pre-exisiting cache

Carl Shelbourne (JIRA) jira-events at lists.jboss.org
Fri Nov 9 10:24:44 EST 2007


Exception thrown when connecting to a pre-exisiting cache
---------------------------------------------------------

                 Key: JBCACHE-1213
                 URL: http://jira.jboss.com/jira/browse/JBCACHE-1213
             Project: JBoss Cache
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Replication
    Affects Versions: 2.0.0.GA
         Environment: JBoss cache 2.0.0GA; Dependancies according to POM excluding JGroups, using JGroups 2.5.0GA; WinXP SP2. Javba 1.6.0_02
            Reporter: Carl Shelbourne
         Assigned To: Manik Surtani
            Priority: Minor


When attempting to connect to an existing cache, the following exceptions are thrown. The exception appears to be thrown before the cache state has transferred to started from either created or starting. This exception is only seen once we have connected to a cache, disconnected from the cache, then subsequently reconnected re-using the same Cache instance object. When the client disconnects it call Cache.stop().

The following method is used to get the cache:
private Cache getTreeCache()
    {
        if ( _treeCache != null )
        {
            if ( _treeCache.getCacheStatus() == CacheStatus.DESTROYED )
            {
                _treeCache.create();
                _treeCache.start();
            }
            else if ( _treeCache.getCacheStatus() == CacheStatus.CREATED )
            {
                _treeCache.start();
            }            
        }               
        return _treeCache;
    }  

And we call this to close the cache once the client has finished with it. Please note other clients will most probably still be connected to the cache ensuring the cache state is maintained

public void destroy()
    {
        if ( _treeCache != null )
        {
            _treeCache.stop();           
            _treeCache.destroy();
        }
    }

the cache is initially create with:

...
CacheFactory factory = DefaultCacheFactory.getInstance();
...
Cache cache = factory.createCache( config, false );
...

Exception on second and subsequent attempts to connect to cache:

WARN [Incoming Thread,192.168.106.139:1827] (CacheImpl.java:2866:org.jboss.cache.CacheImpl:_replicate) - replication failure with method_call MethodName: _remove; MethodIdInteger: 5; Args: (null, /alarm/6834, true) exception

java.lang.IllegalStateException: Cache not in STARTED state!

	at org.jboss.cache.CacheImpl.invokeMethod(CacheImpl.java:3929)

	at org.jboss.cache.CacheImpl._replicate(CacheImpl.java:2853)

	at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

	at java.lang.reflect.Method.invoke(Method.java:597)

	at org.jgroups.blocks.MethodCall.invoke(MethodCall.java:330)

	at org.jboss.cache.marshall.InactiveRegionAwareRpcDispatcher.handle(InactiveRegionAwareRpcDispatcher.java:77)

	at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:624)

	at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:533)

	at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:365)

	at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:736)

	at org.jgroups.JChannel.up(JChannel.java:1063)

	at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:325)

	at org.jgroups.protocols.pbcast.FLUSH.up(FLUSH.java:406)

	at org.jgroups.protocols.pbcast.STREAMING_STATE_TRANSFER.up(STREAMING_STATE_TRANSFER.java:255)

	at org.jgroups.protocols.FRAG2.up(FRAG2.java:197)

	at org.jgroups.protocols.pbcast.GMS.up(GMS.java:722)

	at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234)

	at org.jgroups.protocols.UNICAST.up(UNICAST.java:263)

	at org.jgroups.protocols.pbcast.NAKACK.handleMessage(NAKACK.java:720)

	at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:546)

	at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:167)

	at org.jgroups.protocols.FD.up(FD.java:322)

	at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:298)

	at org.jgroups.protocols.MERGE2.up(MERGE2.java:145)

	at org.jgroups.protocols.Discovery.up(Discovery.java:220)

	at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1486)

	at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1440)

	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

	at java.lang.Thread.run(Thread.java:619)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list