jak*_*kob 7 java testng spring nosuchmethoderror
我编写了一个测试,其中我用注释指定了我的应用程序上下文位置.然后我将我的dao自动装入测试中.
@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());
}
});
}
Run Code Online (Sandbox Code Playgroud)
当我运行测试时,我得到一个异常,表明无法加载应用程序上下文,它归结为:
Caused by: java.lang.NoSuchMethodError:
org.springframework.beans.MutablePropertyValues.add(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/beans/MutablePropertyValues;
我不知道从哪里开始寻找,为什么我会收到此错误,我该如何解决?Info springframework 3.0.2.RELEASE,Hibernate 3.4.0.GA,testng 5.9
谢谢!
| 归档时间: |
|
| 查看次数: |
13081 次 |
| 最近记录: |