2 Replies Latest reply on Jun 13, 2017 8:27 AM by Shankar Sea

    is it possible for infinispan hot rod client to not error out when instance of server not running

    Shankar Sea Novice

      I was wondering, when I start my application and there are no instances of the infinispan server running, the application errors out:

       

      2017-06-06 20:21:23 ERROR [main] o.i.c.h.i.o.RetryOnFailureOperation [RetryOnFailureOperation.java:126] - ISPN004007: Exception encountered. Retry 10 out of 10

      org.infinispan.client.hotrod.exceptions.TransportException: Could not fetch transport

        at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.borrowTransportFromPool(TcpTransportFactory.java:418)

        at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.getTransport(TcpTransportFactory.java:250)

        at org.infinispan.client.hotrod.impl.operations.FaultTolerantPingOperation.getTransport(FaultTolerantPingOperation.java:28)

        at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:55)

        at org.infinispan.client.hotrod.impl.RemoteCacheImpl.ping(RemoteCacheImpl.java:491)

        at org.infinispan.client.hotrod.impl.RemoteCacheImpl.resolveCompatibility(RemoteCacheImpl.java:558)

        at org.infinispan.client.hotrod.RemoteCacheManager.createRemoteCache(RemoteCacheManager.java:270)

        at org.infinispan.client.hotrod.RemoteCacheManager.getCache(RemoteCacheManager.java:154)

        at org.infinispan.client.hotrod.RemoteCacheManager.getCache(RemoteCacheManager.java:149)

        at com.pcf.cardinal.cache.config.CacheConfig.sessionCacheClient(CacheConfig.java:29)

        at com.pcf.cardinal.cache.config.CacheConfig$$EnhancerBySpringCGLIB$$c77240db.CGLIB$sessionCacheClient$2(<generated>)

        at com.pcf.cardinal.cache.config.CacheConfig$$EnhancerBySpringCGLIB$$c77240db$$FastClassBySpringCGLIB$$c1664778.invoke(<generated>)

        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)

        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)

        at com.pcf.cardinal.cache.config.CacheConfig$$EnhancerBySpringCGLIB$$c77240db.sessionCacheClient(<generated>)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

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

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

        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)

        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)

        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)

        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)

        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)

        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)

        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)

        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)

        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)

        at com.pcf.cardinal.channel.configuration.ChannelConfigurationApplication.main(ChannelConfigurationApplication.java:12)

      Caused by: org.infinispan.client.hotrod.exceptions.TransportException: Could not connect to server: /127.0.0.1:11222

        at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.<init>(TcpTransport.java:85)

        at org.infinispan.client.hotrod.impl.transport.tcp.TransportObjectFactory.makeObject(TransportObjectFactory.java:38)

        at org.infinispan.client.hotrod.impl.transport.tcp.TransportObjectFactory.makeObject(TransportObjectFactory.java:17)

        at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)

        at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.borrowTransportFromPool(TcpTransportFactory.java:412)

        ... 51 common frames omitted

      Caused by: java.net.ConnectException: Connection refused

        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)

        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)

        at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:111)

        at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.<init>(TcpTransport.java:75)

        ... 55 common frames omitted

       

      Is there some mechanism to not do this and let my application still start up (with the understanding that if any cache related operations happen then it errors out)? I have used Apache Ignite where it allows Clients to start in a Client/Server mode so that this doesn't happen.