2 Replies Latest reply on Jul 16, 2013 7:55 PM by Tommy T

    Clustered Cache - Transport not defined

    Tommy T Newbie



      I am trying to configure a distributed cache. I have two jboss servers running in domain mode (two servers on one Jboss instance). I am trying to modify the CDI quickstart but the (current!!) error is



      {code}JaxRsActivator threw exception: org.jboss.resteasy.spi.UnhandledException: org.infinispan.config.ConfigurationException: Cache cannot use a clustered mode (DIST_ASYNC) mode and not define a transport! {code}




      I have pasted my code below...how can i set the Transport mode or modify my code to use the pattern taken from the quickstart?


      My code:





      @Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD})



      public @interface UserCache {










      public class Config {



                Logger logger;


      //*********code from quickstart

      //    @ConfigureCache("user-cache") // This is the cache name.

      //    @UserCache // This is the cache qualifier.

      ////    @ApplicationScoped

      //    @Produces

      //    public Configuration userCacheConfiguration() {

      //        return new ConfigurationBuilder()

      //                    .eviction()

      //                        .strategy(EvictionStrategy.LRU)

      //                        .maxEntries(100000)

      //                    .build();

      //    }




                public Cache<String, Long> configureCacheManager() {

                          logger.info("  producing user cache....");


      EmbeddedCacheManager manager= new DefaultCacheManager(); 

              manager.defineConfiguration("user-cache", new ConfigurationBuilder()






              Cache<String, Long> cache = manager.getCache("user-cache");

              logger.info("returning user cache...."+cache.getName());

              return cache;







      service using the cache




      public class UserCacheService {



                Logger logger;


                   @CachePut(cacheName = "user-cache")

                   public void login(@CacheKeyParam String cookieValue, @CacheValue Long userId) {

                      logger.info(" *********** Logging in user into cache map : "+ userId);