qq_25611965
◔▽◔程序媛
采纳率50%
2018-01-16 03:47 阅读 2.3k
已采纳

spring4报错Failed to read candidate component class

5

环境sprin4 , jdk 1.8
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component c
lass: file [D:\workspace_Resin\App\target\classes\cn\activity\service\UserProfileServi
ce.class]; nested exception is java.lang.IllegalArgumentException
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCa
ndidateComponents(ClassPathScanningCandidateComponentProvider.java:281)
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBea
nDefinitionScanner.java:242)
at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentS
canBeanDefinitionParser.java:84)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSuppo
rt.java:73)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(Bea
nDefinitionParserDelegate.java:1438)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(Bea
nDefinitionParserDelegate.java:1428)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefini
tions(DefaultBeanDefinitionDocumentReader.java:184)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanD
efinitions(DefaultBeanDefinitionDocumentReader.java:140)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDef
initions(DefaultBeanDefinitionDocumentReader.java:111)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(Xml
BeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBe
anDefinitionReader.java:390)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBean
DefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBean
DefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinition
s(AbstractBeanDefinitionReader.java:174)

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    qingtianlong97 Always_MyLoverX 2018-01-16 03:50

    配置没问题的话检查你的项目jdk编译环境
    spring3.x的版本是不支持jdk1.8的
    spring4.x的版本是支持jdk1.8的

    图片说明

    点赞 评论 复制链接分享
  • airfling airfling 2018-01-16 05:27

    应该是你的xml文件里面有配置错误的地方

    点赞 评论 复制链接分享

相关推荐