java.nio.channels.SocketChannel is a restricted class Error integrating Memcache with sprin...

Datetime:2016-08-23 01:30:09          Topic: Memcached  Java           Share

I have added the following bean definition and dependencies for integrate my springmvc application deployed on appengine with memcache

 <!-- Memcache Dependency -->
		<dependency>
			<groupId>com.google.code.simple-spring-memcached</groupId>
			<artifactId>spring-cache</artifactId>
			<version>3.1.0</version>
		</dependency>
		<dependency>
			<groupId>com.google.code.simple-spring-memcached</groupId>
			<artifactId>xmemcached-provider</artifactId>
			<version>3.1.0</version>
		</dependency>
===========================================================================
<bean name="cacheManager" class="com.google.code.ssm.spring.SSMCacheManager">
		<property name="caches">
			<set>
				<bean class="com.google.code.ssm.spring.SSMCache">
					<constructor-arg name="cache" index="0" ref="defaultCache"/>
					<!-- 5 minutes -->
					<constructor-arg name="expiration" index="1" value="300"/>
					<!-- @CacheEvict(..., "allEntries" = true) doesn't work -->
					<constructor-arg name="allowClear" index="2" value="false"/>
				</bean>
			</set>
		</property>
	</bean>
	<bean name="defaultCache" class="com.google.code.ssm.CacheFactory">
		<property name="cacheName" value="defaultCache"/>
		<property name="cacheClientFactory">
			<bean name="cacheClientFactory" class="com.google.code.ssm.providers.xmemcached.MemcacheClientFactoryImpl"/>
		</property>
		<property name="addressProvider">
			<bean class="com.google.code.ssm.config.DefaultAddressProvider">
				<property name="address" value="127.0.0.1:11211"/>
			</bean>
		</property>
		<property name="configuration">
			<bean class="com.google.code.ssm.providers.CacheConfiguration">
				<property name="consistentHashing" value="true"/>
			</bean>
		</property>
	</bean>
</beans>

But I keep getting the below error

Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.cache.interceptor.CacheInterceptor#0′: Cannot resolve reference to bean ‘cacheManager’ while setting bean property ‘cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘cacheManager’ defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Cannot create inner bean ‘com.google.code.ssm.spring.SSMCache#52f1a4a9′ of type [com.google.code.ssm.spring.SSMCache] while setting bean property ‘caches’ with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.google.code.ssm.spring.SSMCache#52f1a4a9′ defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Cannot resolve reference to bean ‘defaultCache’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘defaultCache': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: java.nio.channels.SocketChannel is a restricted class. Please see the Google App Engine developer’s guide for more details.:

java.lang.NoClassDefFoundError: java.nio.channels.SocketChannel is a restricted class. Please see the Google App Engine developer’s guide for more details.

at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)





About List