Java 带有Spring配置的EHcache+;使用
我正在尝试用Spring3.0实现缓存 以下是与集成相关的代码:Java 带有Spring配置的EHcache+;使用,java,spring,ehcache,jdbctemplate,spring-jdbc,Java,Spring,Ehcache,Jdbctemplate,Spring Jdbc,我正在尝试用Spring3.0实现缓存 以下是与集成相关的代码: <bean id="cacheManager" class="net.sf.ehcache.CacheManager"> <constructor-arg index="0" type="java.net.URL" value="classpath:ehcache.xml"/> </bean> 有人知道我做错了什么吗?看来你应该把ehcache核心jar添加到你的类路径中。。。但请注意
<bean id="cacheManager" class="net.sf.ehcache.CacheManager">
<constructor-arg index="0" type="java.net.URL" value="classpath:ehcache.xml"/>
</bean>
有人知道我做错了什么吗?看来你应该把ehcache核心jar添加到你的类路径中。。。但请注意,要添加正确的版本 编辑: 请注意,
ehcache
在artifactId
中使用,而不是ehcache核心
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>1.6.1</version>
</dependency>
net.sf.ehcache
ehcache
1.6.1
再次运行mvn安装后,请确保正确的jar驻留在您的本地存储库中,并且它包含正确的类。似乎您应该将ehcache core jar添加到您的类路径中。。。但请注意,要添加正确的版本 编辑: 请注意,
ehcache
在artifactId
中使用,而不是ehcache核心
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>1.6.1</version>
</dependency>
net.sf.ehcache
ehcache
1.6.1
再次运行mvn安装后,请确保正确的jar驻留在您的本地存储库中,并且它包含正确的类。请将您的ehcache jar添加到web inf/lib目录 如果您使用的是Maven,请将其添加到pom.xml中
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.4.7</version>
</dependency>
net.sf.ehcache
ehcache
2.4.7
请将ehcache JAR添加到web inf/lib目录
如果您使用的是Maven,请将其添加到pom.xml中
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.4.7</version>
</dependency>
net.sf.ehcache
ehcache
2.4.7
如果从eclipse启动项目,请检查是否已将ehcache库添加到“部署程序集”列表中
打开项目的属性对话框->“部署程序集”,并在其中添加库
hth如果您从eclipse启动项目,请检查是否已将ehcache库添加到“部署程序集”列表中 打开项目的属性对话框->“部署程序集”,并在其中添加库
hth我在一个容器中添加了1.6.1罐builtpath@Anurag您的pom.xml文件内容是什么?它包含依赖项吗?@AravindA是的,先生,net.sf.ehcache-ehcache-core1.6.1我在builtpath@Anurag您的pom.xml文件内容是什么?它包含依赖项吗?@AravindA是的,先生,net.sf.ehcache-ehcache-core 1.6.1我当前的ehcache版本是1.6.1,尽管我已经添加了ehcache-1.6.1.jar bt,但是如果我发布application-context.xml文件,它仍然不起作用。我认为我做错了,dere。我不认为发布你的applicationContext.xml会有帮助。我添加了您应该使用的maven依赖项。尽管我已经添加了ehcache-1.6.1.jar bt,但我当前的ehcache版本是1.6.1。如果我发布application-context.xml文件,它仍然无法工作。我认为我做错了,dere。我不认为发布你的applicationContext.xml会有帮助。我添加了您应该使用的maven依赖项。试试看。