java.nio.channels.SocketChannel是一个限制类错误,它将Memcache与springmvc控制器和appengine

时间:2015-08-11 04:37:21

标签: java spring google-app-engine spring-mvc memcached

我添加了以下bean定义和依赖项,用于集成我的springmvc应用程序,该应用程序使用memcache集成在appengine上

 <!-- 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>

但我一直收到以下错误

嵌套在org.springframework.beans.factory.BeanCreationException:创建名称为&#39; org.springframework.cache.interceptor.CacheInterceptor#0&#39;:无法解析对bean&#39; cacheManager&#的引用时出错39;设置bean属性&#39; cacheManager&#39 ;;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; cacheManager&#39;的bean时出错。在ServletContext资源[/WEB-INF/spring-servlet.xml]中定义:无法创建内部bean&#39; com.google.code.ssm.spring.SSMCache#52f1a4a9&#39;类型[com.google.code.ssm.spring.SSMCache]设置bean属性&#39;缓存&#39;用键[0];嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为“com.google.code.ssm.spring.SSMCache#52f1a4a9&#39;在ServletContext资源[/WEB-INF/spring-servlet.xml]中定义:无法解析对bean的引用&#39; defaultCache&#39;设置构造函数参数时;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为&#39; defaultCache&#39;:FactoryBean的bean在创建对象时引发异常;嵌套异常是java.lang.NoClassDefFoundError:java.nio.channels.SocketChannel是一个受限制的类。有关详细信息,请参阅Google App Engine开发人员指南: java.lang.NoClassDefFoundError:java.nio.channels.SocketChannel是一个受限制的类。有关详细信息,请参阅Google App Engine开发人员指南。     在com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)

0 个答案:

没有答案