Ehcache

Grails ehcache plugin - Another unnamed CacheManager already exists in the same VM

筅森魡賤 提交于 2019-12-07 04:54:42
问题 I run my Grails application using ehcache for my 2nd level Cache and it works. I installed the ehcache plugin + cache plugin and then it doesn't. I tried almost all solutions from the internet and found no solution I keep getting Another unnamed CacheManager already exists in the same VM . One of the possible solutions is to set p:shared=true in the EhCacheManagerFactoryBean , this works if I use an old plugin "springcache plugin from grails" but with the new plugin they use a modified

How to clear ehcache without server restart

南楼画角 提交于 2019-12-07 04:47:13
问题 Though I guess its highly unlikely - but is there any way to clear the ehcache without restarting the server? I need to clear the cache for some testing - I cannot change the code and cannot afford to restart server at multiple times. PS: I am using apache-tomcat-5.5.25 Please let me know. Thanks, psvm 回答1: Do you expose Ehcache via JMX? Then you could clear the cache using JMX operations by using a tool like e.g. jvisualvm. Look for MBeans like net.sf.ehcache.CacheManager which provide a

Maven error when resolving dependency

你离开我真会死。 提交于 2019-12-07 03:32:18
问题 I am new to Maven and am trying to set up one of my first POM s. My application will cache using EhCache. Going to Maven Central Repo (link here) I copy-n-pasted the <dependency> tag and copy it into my pom.xml like so: ...many dependencies above this point <dependency> <scope>compile</scope> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>4.0.1.Final</version> </dependency> <dependency> <scope>compile</scope> <groupId>net.sf.ehcache</groupId>

ehcache hibernate 4

大憨熊 提交于 2019-12-07 02:21:58
问题 In my application I use the hibernate-core-4.1.8 jar and would like to take an ehCache as 2nd level cache. The jar I am currently using is ehcache-core-2.5.0. I placed it in my WebContetn/WEB-INF/lib folder and put it in the classpath too. My hibernate.cfg.xml looks like this: <hibernate-configuration> <session-factory> .... <property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property> <property name="hibernate.cache.use_second_level_cache"

How to configure EHcache for standalone Java program without using hibernate / spring interceptors?

戏子无情 提交于 2019-12-06 23:45:46
问题 Can anyone please post an example to configure Ehcache for a standalone java application? I have the following simple requiremens: getting data from database, formatting that data and writing to file I am using jdbctemplate.Query , it is executing quickly but the retrieval from list is taking quite a while. List is holding large volume of data (resultset). Can anyone suggest how to overcome this problem? 回答1: This is a very old post, but it seems to kick back regularly so.... You should

@Cachebale not working with Ehcache and spring MVC Ehcache not working with Spring Caching Annotation

随声附和 提交于 2019-12-06 16:44:45
My application is Spring MVC application. Tried using Spring Annotation based Caching. But it not working. Please refer my code below 1. pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.giggal.spring</groupId> <artifactId>spring-tutorial-mvc</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> ...... <dependencies> <dependency> <groupId>org.springframework</groupId

JFinal 整合 Shiro

大城市里の小女人 提交于 2019-12-06 15:53:53
(例子+源码 http://my.oschina.net/smile622/blog/203459) 最近整合JFinal和Shiro遇到的问题,希望能给你们提示与帮助。 首先,JFinal和Shiro本人都是刚刚接触,JFinal上手很快,但Shiro上手比较费劲,看了很长时间的文档。 下面说一下整合JFinal配置这里就不说了。 按照官方Shiro配置 1、添加shiro-all-1.2.1.jar 包括Shiro所依赖的jar包commons-beanutils-1.8.3.jar、commons-logging-1.1.3.jar和ehcache-core-2.6.6.jar 2、配置web.xml ? 1 2 3 4 5 6 7 8 9 10 11 12 13 <listener> <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class> </listener> <filter> <filter-name>ShiroFilter</filter-name> <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class> </filter> <filter-mapping> <filter

how to prevent a return value from cache to be changed in spring cacheable

痴心易碎 提交于 2019-12-06 14:21:54
问题 i'm working around spring 3.1 annotation cache with ehcache as a cache implement. a method with return value like this @Cacheable("cache") public MyObject getObj(Object param); i got a myobject return value for the first time,and it's editable. ehcache can do something for that by setting "copyOnRead" or "copyOnWrite". it will force serialize object on read/write. but at the first time spring will not get value from cache,it always return by method itself. is there some way to get a readonly

Spring @Cacheable is breaking @RequestMapping

Deadly 提交于 2019-12-06 14:02:54
I have upgraded my application to Spring 3.1 and all the jars have been adequately updated. But when I try to use @Cacheable for a method in one of my controllers, URL mapping for all the methods of that controller breaks. On checking the log files I found that the URL mapping for all the methods of that controller were never detected. I am pretty sure that my cache configurations are fine. Can anyone give me some clue as what I might be doing wrong. ehcache.xml <?xml version="1.0" encoding="UTF-8"?> <ehcache> <defaultCache eternal="false" maxElementsInMemory="2" overflowToDisk="false"

Getting “Another unnamed CacheManager already exists” error when running Hibernate 5 with my Junit 4 tests

天涯浪子 提交于 2019-12-06 13:55:40
问题 I recently upgraded to Hibernate 5.1.0.Final (with accompanying ehache) and am using Spring 3.2.11.RELEASE. Despite following the advice here -- Another unnamed CacheManager already exists in the same VM (ehCache 2.5), I'm seeing an error when running my JUnit tests. I have the following ehcache.xml file in my src/main/resources directory <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../config/ehcache.xsd" updateCheck="false"> <!-- This is a