Results 1 to 3 of 3

Thread: Basic Spring Ehcache declarative caching question/problem combo

  1. #1

    Default Basic Spring Ehcache declarative caching question/problem combo

    I've been tryin to follow the springmodules cache example by piecing together the code samples, and I came up with this simple configuration:

    Code:
    <beans>
    
    	<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" />
    	
    	<bean id="cachingListener" class="com.test.CacheListener" />
    
    	<bean id="cacheProviderFacade" class="org.springmodules.cache.provider.ehcache.EhCacheFacade">
    		<property name="cacheManager" ref="cacheManager" />
    	</bean>
    
    	<bean id="userFacadeCacheProxy" class="org.springmodules.cache.interceptor.proxy.CacheProxyFactoryBean">
    		<property name="cacheProviderFacade" ref="cacheProviderFacade" />
    		<property name="cachingModels">
    			<props>
    				<prop key="get*">cacheName=methodCache</prop>
    			</props>
    		</property>
    			 
    		<property name="cachingListeners">
    			<list>
    				<ref bean="cachingListener" />
    			</list>
    		</property>
    			
    		
    		<property name="target" ref="userFacade" />
    	</bean>
    
    </beans>
    So I thought it looked good but nothing gets cached, and I see this guy in the logs:

    Code:
    java.lang.ClassNotFoundException: org.springmodules.cache.config.tangosol.CoherenceNamespaceHandler
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
    But for the life of me I cant find that class anywhere and even google doesnt seem to know much about it. So my first question is, is that whats causing my cache to not work and if so, where can i find that jar?

    Second question, I am using the expression get* for the cachingmodel just for simplicity. In actuality though, there are 2 get methods in the class I am testing:
    getSomething()
    getSomething(String argument)

    I really dont want the second one to get cached though because the results will be too unique. Is there anyway I can specify to use the one without the String argument, without changing the method names?

  2. #2

    Default

    I found the class in the 09 snapshot, and after replacing the original spring-modules-cache.jar that error went away, however cache itself still doesnt seem to be working. Is there anything obviously wrong with my configuration?

  3. #3

    Default

    Well I figured out what I was doing wrong, I needed to swap ids userFacadeCacheProxy and userFacade. So cache works, but I still can't differentiate between methods with different arguments in them. Im not sure if there is a syntax or its not implemented. If anyone could let me know I'd appreciate it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •