J'ai écrit un test où je spécifie l'emplacement de mon contexte d'application avec des annotations. Je puis autowire mon dao dans le test.NoSuchMethodError avec Spring MutableValues
@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());
}
});
}
Quand je lance le test que je reçois une exception qui indique que le contexte d'application n'a pas pu être chargé et il se résume à:
Caused by: java.lang.NoSuchMethodError: org.springframework.beans.MutablePropertyValues.add(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/beans/MutablePropertyValues;
Je ne sais pas où commencer à chercher, pourquoi J'ai cette erreur et comment puis-je la résoudre? Info springframework 3.0.2.RELEASE, Hibernate 3.4.0.GA, testng 5.9
Merci!
Vous avez raison, j'avais une dépendance au printemps 2.5.6 dans mon projet. – jakob