ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new S 看上去是jar有问题的样子,这是junit测试?试试这个 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 起始我用的就是你说的spring自带的注解方式的,但是也是报同样的错误,但是我运行项目是没有任何问题的,就是用junit测试有问题 @RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(locations = { "classpath:spring.xml","classpath:spring-mvc.xml","classpath:spring-mybatis.xml" })@TransactionConfiguration(defaultRollback = false)//事务不回滚@Transactionalpublic class BaseTestTemplate {}public class TestUserMapper extends BaseTestTemplate{ @Autowired UserMapper userMapper; DecimalFormat df = new DecimalFormat("0000"); @Test public void insert() { System.out.println(userMapper); }} tomcat服务器相关 正则表达式过滤html标签 怎么用websphare来打包成war 网站被曝有user-agent漏洞,这是什么东西? 关于struts2标签库的一个问题 jsp mysql utf8中文乱码问题 word控件是怎么实现的 如何能让一个界面只一段代码只执行一次, 同僚们,工作需要,从php转jsp,问几个简单的问题: 比较麻烦的问题,请大侠指教 关于shiro做的一个登录测试 JSF2.0中,怎样在托管Bean中调用xhtml页面中的js脚本
但是我运行项目是没有任何问题的,就是用junit测试有问题
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:spring.xml","classpath:spring-mvc.xml","classpath:spring-mybatis.xml" })
@TransactionConfiguration(defaultRollback = false)//事务不回滚
@Transactional
public class BaseTestTemplate {}public class TestUserMapper extends BaseTestTemplate{ @Autowired
UserMapper userMapper;
DecimalFormat df = new DecimalFormat("0000");
@Test
public void insert() {
System.out.println(userMapper);
}
}