java.lang.NoSuchMethodError

Description

While runing my web application web test (I use Appfuse2.0 Final with struts) I got this error:
------------------------------------------------------- T E S T S
------------------------------------------------------- Running my.webapp.action.ReservationActionTest
INFO [main] ReservationActionTest.loadContextLocations(177) | Loading context for locations: classpath:/applicationContext-resources.xml,classpath:/applicationContext-dao.xml,classpath:/applicationContext-service.xml,classpath*:/applicationContext.xml,/WEB-INF/applicationContext*.xml
WARN [main] CglibSubclassingInstantiationStrategy.instantiate(124) | Factory method [public static org.springframework.transaction.aspectj.AnnotationTransactionAspect org.springframework.transaction.aspectj.AnnotationTransactionAspect.aspectOf()] threw exception
org.aspectj.lang.NoAspectBoundException: Exception while initializing org_springframework_transaction_aspectj_AnnotationTransactionAspect: java.lang.NoSuchMethodError: org.springframework.transaction.annotation.AnnotationTransactionAttributeSource.<init>(Z)V
at org.springframework.transaction.aspectj.AnnotationTransactionAspect.aspectOf(AnnotationTransactionAspect.aj:1)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:109)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:281)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:665)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:617)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:290)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)
at org.springframework.test.AbstractSingleSpringContextTests.createApplicationContext(AbstractSingleSpringContextTests.java:199)
at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:179)
at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:158)
at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:105)
at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:87)
at junit.framework.TestCase.runBare(TestCase.java:132)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
Caused by: java.lang.NoSuchMethodError: org.springframework.transaction.annotation.AnnotationTransactionAttributeSource.<init>(Z)V
at org.springframework.transaction.aspectj.AnnotationTransactionAspect.<init>(AnnotationTransactionAspect.aj:49)
at org.springframework.transaction.aspectj.AnnotationTransactionAspect.ajc$postClinit(AnnotationTransactionAspect.aj:1)
at org.springframework.transaction.aspectj.AnnotationTransactionAspect.<clinit>(AnnotationTransactionAspect.aj:46)
... 39 more

Environment

<dependency>
<groupId>com.octo.captcha</groupId>
<artifactId>jcaptcha-all</artifactId>
<version>1.0-RC6</version>
<scope>compile</scope>
</dependency>

<appfuse.version>2.0</appfuse.version>
<spring.version>2.0.6</spring.version>

Activity

Show:
Rostislav Palivoda
September 30, 2007, 11:36 AM
Rostislav Palivoda
October 1, 2007, 9:45 AM

After update jcaptcha-all-1.0-RC6.pom with
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.0.6</version>
</dependency>
this error passed.

AntoineV
November 5, 2007, 5:03 PM

Upgrade Spring to 2.0.6

AntoineV
November 30, 2007, 2:08 PM

In order to assign the good resolution : fixed

AntoineV
December 26, 2007, 2:29 PM

The Spring dependency has been removed, Spring version have to be define in the user project

Fixed

Assignee

AntoineV

Reporter

Rostislav Palivoda

Labels

None

Fix versions

Affects versions

Priority

Major
Configure