NoSuchMethodError with Spring MutableValues

I wrote a test where I indicate my location of the application context with annotations. Then I complete my Tao test.

@ContextConfiguration(locations = {"file:service/src/main/webapp/WEB-INF/applicationContext.xml"}) public class MyTest extends AbstractTestNGSpringContextTests { @Autowired protected MyDao myDao; private PlatformTransactionManager transactionManager; private TransactionTemplate transactionTemplate; @Test public void shouldSaveEntityToDb() { transactionTemplate.execute(new TransactionCallbackWithoutResult() { protected void doInTransactionWithoutResult(TransactionStatus status) { Entity entity = new Entity(); //test myDao.save(entity) //assert assertNotNull(entity.getId()); } }); } 

When I run the test, I get an exception that indicates that the application context cannot be loaded, and it boils down to the following:

     Caused by: java.lang.NoSuchMethodError:
     org.springframework.beans.MutablePropertyValues.add (Ljava / lang / String; Ljava / lang / Object;) Lorg / springframework / beans / MutablePropertyValues;

I have no idea where to start, why am I getting this error and how to solve it? Information springframework 3.0.2.RELEASE, Hibernate 3.4.0.GA, testng 5.9

Thanks!

+7
java spring nosuchmethoderror testng
source share
1 answer

This method was added in Spring 3.0, so you probably have a pre-3.0 Spring version somewhere in the classpath. Check your class path.

+10
source share

All Articles