`
kevin19900306
  • 浏览: 448579 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

关于BeanDefinitionStoreException的解决办法

阅读更多
在项目中使用Java8、spring3、tomcat7,结果报错:
[org.springframework.web.context.ContextLoader]Root WebApplicationContext: initialization started
[org.springframework.web.context.support.XmlWebApplicationContext]Refreshing Root WebApplicationContext: startup date [Tue Sep 22 20:47:08 CST 2015]; root of context hierarchy
[org.springframework.beans.factory.xml.XmlBeanDefinitionReader]Loading XML bean definitions from class path resource [spring.xml]
[org.springframework.context.annotation.ClassPathBeanDefinitionScanner]JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
[org.springframework.web.context.ContextLoader]Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\ws\langying\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\manager\WEB-INF\classes\com\writing\manager\action\LanguageToolAction.class]; nested exception is java.lang.IllegalArgumentException
    at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:281)
    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242)
    at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)
    at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1435)
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1425)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5528)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.IllegalArgumentException
    at org.springframework.asm.ClassReader.<init>(Unknown Source)
    at org.springframework.asm.ClassReader.<init>(Unknown Source)
    at org.springframework.asm.ClassReader.<init>(Unknown Source)
    at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:52)
    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
    at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
    at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:257)
    ... 32 more
 解决办法:把java版本改成1.7就可以了
最好版本一致:java7、tomcat7、spring3
分享到:
评论

相关推荐

    spring mvc 项目错误,和一些配置

    根据提供的文档信息,我们可以归纳总结出一系列与Spring MVC框架相关的常见问题及解决方案...通过以上内容,我们不仅总结了Spring MVC项目中可能出现的各种问题及其解决办法,还提供了基本的代码示例,帮助初学者更好地...

    spring+xfire集成解决方案

    org.springframework.beans.factory.BeanDefinitionStoreException: Line 4 in XML document from ServletContext resource [/WEB-INF/classes/applicationContext.xml] is invalid; nested exception is org.xml....

    火狐报错事项

    在IT领域,特别是软件开发与部署过程中,遇到错误提示是家常便饭,而解析这些错误信息并找到解决办法则是每位开发者必须掌握的技能之一。本文将深入解析一个与Spring框架相关的错误:“火狐报错事项”,具体错误信息...

    jaxrs导致的错误

    5. **日志分析**:深入分析应用的日志文件,寻找更多关于异常发生的具体信息,这有助于定位问题的根源。 6. **单元测试与集成测试**:编写针对性的单元测试和集成测试,用以验证REST资源的正确性和服务端点的可达性...

    Spring 3.0所需jar文件和对应的配置文件

    解决异常: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is java.lang....

    struts,spring,hibernater集合文档

    - 异常类型:`org.springframework.beans.factory.BeanDefinitionStoreException` - 解决方案:确保配置文件(例如 `action-servlet.xml`)正确放置于 `WEB-INF` 目录下。 #### Hibernate 与 Spring 的集成 ...

    P01_SpringPrimefaces:参见 readme.md - Primefaces + Spring + Hibernate 集成示例

    tá com pau:GRAVE:上下文初始化失败 org.springframework.beans.factory.BeanDefinitionStoreException:无法读取候选组件类:文件 [E:\FGH\Documents_FabioGM\Java\Workspace.metadata.plugins\org.eclipse.wst...

    spring2.5.6源码

    这个方法的目的一目了然,就是为了将资源解释成为Document对象,然后调用registerBeanDefinitions方法,这里不做详细解释,不了解的话请去看看关于JAXP的介绍。接下来我们打开registerBeanDefinitions方法: Java...

    Spring解密之XML解析与Bean注册示例详解

    public int loadBeanDefinitions(EncodedResource encodedResource) throws BeanDefinitionStoreException { try { InputStream inputStream = encodedResource.getResource().getInputStream(); // ... } } ```...

    sonar-JAVA检查规则指南.docx

    但是,如果在默认包中使用“@ComponentScan”,可能会导致应用程序启动速度变慢,并且可能会导致 BeanDefinitionStoreException。 6. 不要使用“BigDecimal(double)”构造函数 在 Java 中,使用“BigDecimal...

    sonar-JAVA检查规则指南.docxsonar-JAVA检查规则指南_.docx

    - **原因分析**:默认包中的 `@ComponentScan` 会导致 Spring 扫描整个类路径,这不仅可能导致启动时间变慢,还可能引发 `BeanDefinitionStoreException` 异常。 - **推荐做法**:确保使用 `@SpringBoot...

    Spring源码学习五:BeanDefinition装载1

    public int loadBeanDefinitions(EncodedResource encodedResource) throws BeanDefinitionStoreException { Assert.notNull(encodedResource, "EncodedResource must not be null"); if (logger.isInfoEnabled())...

    spring-int-reactor-sftp

    StringUtils,Reactor 2.x 版本中提供了对 React 的 Spring 支持,例如 EnableReactor ./gradlew bootRun Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected...

    SPRING API 2.0.CHM

    All Classes ...BeanDefinitionStoreException BeanDefinitionValidationException BeanDefinitionValueResolver BeanDefinitionVisitor BeanEntry BeanFactory BeanFactoryAspectInstanceFactory ...

Global site tag (gtag.js) - Google Analytics