Results 1 to 4 of 4

Thread: Error with AOP using Spring Cache

Hybrid View

  1. #1
    Join Date
    Jun 2012
    Posts
    3

    Default Error with AOP using Spring Cache

    Hi there! I'm testing the Spring cache and, this is my context file:

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans" 
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:cache="http://www.springframework.org/schema/cache"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
    						http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
     
    	<cache:annotation-driven cache-manager="simpleCacheManager"/>
    
    	<bean id="simpleCacheManager" class="org.springframework.cache.support.SimpleCacheManager">
    		<property name="caches">
    			<set>
    				<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
    					<property name="name" value="alfresco"/>
    				</bean> 
    				<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
    					<property name="name" value="alfresco_article"/>
    				</bean> 
    				<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
    					<property name="name" value="alfresco_action"/>
    				</bean>
    				<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
    					<property name="name" value="alfresco_multiplesegment"/>
    				</bean>
        		</set>
      		</property>
    	</bean>
    but, calling the url this happens:

    Code:
    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [configuration-context.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/config/AopNamespaceUtils
        org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
        org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    
    root cause
    
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [configuration-context.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/config/AopNamespaceUtils
        org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
    aop-alliance.jar and org.springframework.aop-3.1.1.RELEASE.jar are both in classpath.

    Any clue?

    thanks,
    Andrea

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default


    aop-alliance.jar and org.springframework.aop-3.1.1.RELEASE.jar are both in classpath.
    Judging from the stacktrace they aren't on the classpath... The fact that they are on your IDE classpath doesn't mean they are automatically on your servers classpath. Make sure they are in the WEB-INF/lib directory for your application.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jun 2012
    Posts
    3

    Default

    Hi Marten,

    thanks for your reply. I also try to put the libs on tomcat/lib folder I use on Eclipse but the error still happens.

    Andrea

  4. #4
    Join Date
    Jun 2012
    Posts
    3

    Default

    No clear why but, after 6 month I'm working on this project, I had to add the lib to the classhpath of Tomcat under Eclipse configuration panel..... bah....

Tags for this Thread

Posting Permissions

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