Announcement Announcement Module
Collapse
No announcement yet.
NoSuchMethodError:org.springframework.aop.framewor k.AopProxyUtils.ultimateTargetClass Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NoSuchMethodError:org.springframework.aop.framewor k.AopProxyUtils.ultimateTargetClass

    Hi Guys,

    Im currently using the 3.1.0-RELEASE for all my spring dependencies in my pom and my application is organized as follows:
    - facade-rest
    - service layer
    - infrastructure

    The thing is that im using the @Cacheable attributes on my infrastructure methods in order to cache any access to my external resources. The thing is that when i run it from my unit tests, it works perfectly, but when i run it from the rest api deployed in my tomcat it fires the following exception:

    java.lang.NoSuchMethodError: org.springframework.aop.framework.AopProxyUtils.ul timateTargetClass(Ljava/lang/ObjectLjava/lang/Class;
    at org.springframework.cache.interceptor.CacheAspectS upport.execute(CacheAspectSupport.java:184)
    at org.springframework.cache.interceptor.CacheInterce ptor.invoke(CacheInterceptor.java:66)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy9.getSiteUrl(Unknown Source)

    I have injected correctly the infrastructure instance into the rest services. I enter in debug mode and i can see the proxy that has the cacheable methods listed, etc. Everything seems to be correct but it seems that the aop dependency for 3.1.0-RELEASE does not have the method "ultimateTargetClass" at all.

    Can anyone give us a hint on this one??
    I have also read around that the cacheable attribute does not work on WebContext, but the spring documentation does not says why. It only says that it can cache controller classes.

    Thanks and bests,
    Alan.

  • #2
    Hi Alan,
    I just ran into the same problem. Did you happen to find a fix for this?

    thanks,
    Mark

    Comment


    • #3
      Yeah, It seems as if there are some issues in here that someone needs to take a look at. I just ran into kinda similar issue here a few minutes ago. All my tests works well with version 3.0.6.RELEASE but I need to take advantage of the propertySourcesPlaceholderConfigurer that came in 3.1. That forced me to upgrade my versions to version 3.1.1.RELEASE and now when I run my tests I get this error and nothing mor that that.

      Code:
      java.lang.NoSuchMethodError: org.springframework.beans.BeanUtils.instantiateClass(Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/Object;
      	at org.springframework.test.context.ContextLoaderUtils.resolveContextLoader(ContextLoaderUtils.java:87)
      	at org.springframework.test.context.ContextLoaderUtils.buildMergedContextConfiguration(ContextLoaderUtils.java:298)
      	at org.springframework.test.context.TestContext.<init>(TestContext.java:100)
      	at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:117)
      	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:119)
      	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:108)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      	at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
      	at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
      	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
      	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
      	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
      	at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Comment


      • #4
        @mota_nginya

        I fixed my problem by adding an exclusion to jersey-spring since it seems to have a dependency on Spring versions prior to 3.1

        Code:
        		
        <dependency>
        	<groupId>com.sun.jersey.contribs</groupId>
        	<artifactId>jersey-spring</artifactId>
        	<version>${jersey-version}</version>
        	<exclusions>
                                      <exclusion>
         	 	                      <groupId>org.springframework</groupId>
         	 	                      <artifactId>spring-aop</artifactId>
         	                       </exclusion>
        				<exclusion>
        					<groupId>org.springframework</groupId>
        					<artifactId>spring</artifactId>
        				</exclusion>
        				<exclusion>
        					<groupId>org.springframework</groupId>
        					<artifactId>spring-core</artifactId>
        				</exclusion>
        				<exclusion>
        					<groupId>org.springframework</groupId>
        					<artifactId>spring-beans</artifactId>
        				</exclusion>
        				<exclusion>
        					<groupId>org.springframework</groupId>
        					<artifactId>spring-context</artifactId>
        				</exclusion>
        				<exclusion>
        					<groupId>org.springframework</groupId>
        					<artifactId>spring-web</artifactId>
        				</exclusion>
                </exclusions>
        </dependency>
        However, your problem seems to be different than mine and I probably can't be of much help on your issue.

        Comment


        • #5
          I do not have a Jersey dependency in my code. But it seems as if it might have something to do with other dependencies on to older versions of spring. I'll look into that and get to this forum with what I find out. In the maintime, if some one comes up with a brighter idea of how to solve this proble, please let me know.

          Comment

          Working...
          X