0

春のシンプルなmemcachedを使用した人はいますか? 正確なmaven依存関係とこれが利用可能なリポジトリを取得できませんでした。code.google ページ (http://code.google.com/p/simple-spring-memcached/) に記載されている依存関係には、他の依存関係が記載されていますが、Simple-spring-memcache 自体の jar は含まれていません。

助けてくれてありがとう。

4

2 に答える 2

2

これを試してください:

<dependency>
  <groupId>com.google.code.simple-spring-memcached</groupId>
  <artifactId>simple-spring-memcached</artifactId>
  <version>2.0.0</version>
</dependency>
于 2012-04-18T18:44:23.120 に答える
1

SSM 2.0.0 の場合、memcached クライアント (xmemcached または spymemcached) も必要です。

<dependency>
    <groupId>com.google.code.simple-spring-memcached</groupId>
    <artifactId>simple-spring-memcached</artifactId>
    <version>2.0.0</version>
</dependency>
<dependency>
    <groupId>com.googlecode.xmemcached</groupId>
    <artifactId>xmemcached</artifactId>
    <version>1.3.5</version>
</dependency> 

ローカル memcached サーバーへの接続を構成します。

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/aop
            http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">

    <import resource="simplesm-context.xml" />
    <aop:aspectj-autoproxy />

    <bean name="defaultMemcachedClient" class="com.google.code.ssm.CacheFactory">
          <property name="cacheClientFactory">
                <bean 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>
于 2012-04-18T20:38:37.690 に答える