首页 新闻 会员 周边 捐助

我百度找不到原因。大神来解

0
[待解决问题]

我用@Component注释后出现这些报错。但是我肯定代码和xml文件应该没错的。第一次博客问问题。希望大家回答哈。谢谢org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'stu1' must be of type [value.Student], but was actually of type [annotation.Student]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:367)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1121)
at test.TestValue.test3(TestValue.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org

嗷嗷嗷嗷嗷嗷嗷嗷喵的主页 嗷嗷嗷嗷嗷嗷嗷嗷喵 | 菜鸟二级 | 园豆:202
提问于:2017-09-23 01:27
< >
分享
所有回答(3)
0

value.Student和annotation.Student的区别,配置错了吧

-忘川- | 园豆:23 (初学一级) | 2017-09-23 14:25

谢谢

0

能不能上下代码!!!!

吉吉的城 | 园豆:566 (小虾三级) | 2017-09-23 17:08

谢谢哈。已经解决。不好意思了。配置问题。。。。

@嗷嗷嗷嗷嗷嗷嗷嗷喵: 恩恩 解决了就行 有时候代码和报错的信息一起传上来 这样更好解决问题

支持(0) 反对(0) 吉吉的城 | 园豆:566 (小虾三级) | 2017-09-23 17:12
0

建议 技术问题不要用百度 请移步谷歌

阿爆g | 园豆:20 (初学一级) | 2017-09-24 01:12
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册