0 Replies Latest reply on Jan 4, 2013 10:01 AM by Vova Kurilow

    IllegalStateException, cluster is already connected to singleton transport

    Vova Kurilow Newbie

      Hello together,

       

      I looked for my issue in google, but didnt find anything what can help me.

       

      I have two caches with replication mode.

       

         <namedCache name="customerCache">

            <clustering mode="replication" />

         </namedCache>

       

         <namedCache name="customerIndexerCache">

            <clustering mode="replication" />

         </namedCache>

      <clustering mode="replication">

               <sync replTimeout="20000"/>

      </clustering>


       

      in global part ob infinispan configuration I configured a jgroup for transport

            <transport

                  clusterName="infinispan-cluster"

                  machineId="m1"

                  rackId="r1" nodeName="Node-A">

               <properties>

                  <property name="configurationFile" value="jgroups.xml" />

               </properties>        

            </transport>

       

      Cache customerIndexerCache is used for infinispanDirectory and is initialized during start of application.

       

      EmbeddedCacheManager manager = new DefaultCacheManager("infinispan.xml");

      Cache<Object, Object> cache = manager.getCache("customerIndexerCache");

       

      customerIndexDirectory = new InfinispanDirectory(cache, "customerIndex");// new RAMDirectory();

       

      writer = new IndexWriter(customerIndexDirectory, config);

       

       

       

       

       

      it works fine.


      customerCache is used with cache annotation from Spring.

      [

      @Cacheable(value = "customerCache", key = "#customerNumber")

                public Customer getCustomer(long customerNumber, Date lastFetch) throws InterruptedException, ExecutionException

                {

      ...

        }

      ]

       

      I configured cacheManager in applicationContext.xml

       

      <bean id="cacheManager" class="org.infinispan.spring.provider.SpringEmbeddedCacheManagerFactoryBean"

                    p:configuration-file-location="infinispan.xml"/>

       

       

      My problem:

      when I call the method getCustomer at runtime, then I get IllegalStateException


      Caused by: java.lang.IllegalStateException: cluster 'infinispan-cluster' is already connected to singleton transport: [searchengine-CustomerService, database-CustomerService, infinispan-cluster, dummy-1357296713945, databaseUpdate-CustomerService, ClusterStatus-CustomerService]

                at org.jgroups.stack.ProtocolStack.startStack(ProtocolStack.java:909)

                at org.jgroups.JChannel.startStack(JChannel.java:841)

                at org.jgroups.JChannel.connect(JChannel.java:277)

                at org.jgroups.JChannel.connect(JChannel.java:261)

                at org.infinispan.remoting.transport.jgroups.JGroupsTransport.startJGroupsChannelIfNeeded(JGroupsTransport.java:184)


      have I forgotten any configuration???

      should I close Connection by myself?

      why does infinispan try to connect to the channel, even the connection is already exist?

       

      before the call of getCustomer I search in my LuceneIndex for the CustomerID's

       

      JGroupsTransport.start() is called, when CacheManager creates a cache.

      I have two different caches. Does this mean that each cache must contain own channel? if yes,how can I configure it??

       

      thank you for your help.