spring

1.maven install的时候:
No compiler is provided in this environment. perhaps you are running on a jre rather than a jdk?
window->perference->java->Installed JREs->把jre换成jdk

2.maven install的时候,程序包org.junit不存在
我是在pom.xml里把

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>3.8.1</version>
    <scope>test</scope>(这里注释掉,maven install就可以了)
</dependency>
  1. junit failed to load applicationcontext
    解决:
    把@ContextConfiguration(locations = {“classpath:applicationContext.xml”})
    改为
    @ContextConfiguration(locations = {“classpath:*.xml”})

4.Error creating bean with name ‘xxx.xx.xx.xxx’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private xxx.yy.zz.xxService….NoSuchBeanDefinitionException:No qualifying beanof type [xx.xxservice] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.
解决:mapping.xml里用到了一个VO对象没有定义(mapping.xml是从其他地方拷过来的)

第二天,又写了个Dao
测试的时候报错:

Error creating bean with name 'xxx':Injection of resource...,...must be of type ...,but was actually of type [com.sun.proxy.$Proxy25]
莫名其妙啊,service上漏加@Service注解了,test里@resource下面的对象申明改了一下,
本来是
@Resource 
private RFUpdDao rFDao;
现在改成:
private RFUpdDao rFUpdDao;
是不是测试案例里不能申明相同的对象。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值