Announcement Announcement Module
Collapse
No announcement yet.
UnsupportedOperationException: operation is not supported on a client cache Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • UnsupportedOperationException: operation is not supported on a client cache

    I am getting below exception while doing client-server configuration using Spring Gemfire. Please see below my client and server configuration files. I am using 1.2.1 version of Spring data gemfire with 7.0 version of vFabric Gemfire.
    HTML Code:
    Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cache-server': Invocation of init method failed; nested exception is java.lang.UnsupportedOperationException: operation is not supported on a client cache
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    	at SaveSales.main(SaveSales.java:23)
    Caused by: java.lang.UnsupportedOperationException: operation is not supported on a client cache
    	at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.addCacheServer(GemFireCacheImpl.java:3117)
    	at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.addCacheServer(GemFireCacheImpl.java:3112)
    	at org.springframework.data.gemfire.server.CacheServerFactoryBean.afterPropertiesSet(CacheServerFactoryBean.java:84)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    	... 12 more
    Server Configuration File-
    HTML Code:
     <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:p="http://www.springframework.org/schema/p"
    	xmlns:util="http://www.springframework.org/schema/util"
    	xmlns:gfe="http://www.springframework.org/schema/gemfire"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
    		http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
    
    	<util:properties id="props">
      		<prop key="log-level">warning</prop> 
      	</util:properties>
    	
    
    	<gfe:cache properties-ref="props"/> 	
    
     	<gfe:cache-server id="cache-server" auto-startup="true" 
    		bind-address="localhost" port="40404" host-name-for-clients="localhost">			
    	</gfe:cache-server>
    	
    	<gfe:replicated-region id="cacheRegion">
     		<gfe:cache-listener>
    			<bean class="com.test.CacheLogger"/>
    		</gfe:cache-listener>
    		<gfe:entry-ttl timeout="1200" action="INVALIDATE"/>
    	</gfe:replicated-region>
    	
     	<bean id="cacheTemplate" class="org.springframework.data.gemfire.GemfireTemplate" p:region-ref="productCacheRegion"/>
    	 
    </beans>
    Client Configuration File-
    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:p="http://www.springframework.org/schema/p"
    	xmlns:util="http://www.springframework.org/schema/util"
    	xmlns:gfe="http://www.springframework.org/schema/gemfire"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
    		http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
    		
    	<util:properties id="props">
      		<prop key="log-level">warning</prop> 
      	</util:properties>	
    		
    	<gfe:client-cache properties-ref="props"/>
     	
    	<gfe:client-region id="cacheRegion" pool-name="gemfire-pool"/>
    	
    	<gfe:pool id="gemfire-pool" subscription-enabled="true">
    		<gfe:server host="localhost" port="40404"/>
    	</gfe:pool>  
    	
    </beans>

  • #2
    That's a strange error. Are you trying to create the client and server in the same process? They must run in separate JVMs

    Comment

    Working...
    X