• java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException


    从svn上把项目迁下来之后,编译通过,但是运行一直报错,报错具体日志如下:

    第一段报错​

    ​java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory. ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory. ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory. ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry. ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory. ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory. ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate. ~[spring-context-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext. ~[spring-context-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext. ~[spring-context-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader. ~[spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader. ~[spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener. [spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    第二段报错

    ava.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Tue May 23 11:23:47 CST 2017]; root of context hierarchy

    at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext. [spring-context-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext. [spring-context-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext. [spring-context-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext. [spring-context-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader. [spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener. [spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    解决办法:

    spring-config.xml文件里面​有一段Mybatis 的配置,如下

      <!-- Mapper接口所在包名,Spring会自动查找其下的Mapper -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <property name="basePackage" value=" com.qumaiyao,com.hys.mds.project.o2o.logic" />
    <property name="markerInterface" value=" com.qumaiyao.MybatisMapper"/>
    </bean>

    在这段配置中新加一行,

    <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />

    修改后的配置如下:

        <!-- Mapper接口所在包名,Spring会自动查找其下的Mapper -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <property name="basePackage" value=" com.qumaiyao,com.hys.mds.project.o2o.logic" />
    <property name="markerInterface" value=" com.qumaiyao.MybatisMapper"/>
    <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
    </bean>

    这样处理后,项目就跑起来了。

    参考博文:

    http://blog.csdn.net/qq_27348011/article/details/51492756​

    http://peterz2011.blog.51cto.com/3186140/1313011

  • 相关阅读:
    MP4文件格式
    ASP.net 学习路线(详细)
    H.264开源解码器评测
    H264编码 封装成MP4格式 视频流 RTP封包
    MP4介绍与基本AVC编码(x264)教程
    创建一个简单的WCF程序
    VUE 从零开始 学习笔记 一
    关于阿里云短信接口的使用
    对Ul下的li标签执行点击事件——如何获取你所点击的标签
    二逼程序员与苦逼程序员
  • 原文地址:https://www.cnblogs.com/0kuxia0/p/6893520.html
Copyright © 2020-2023  润新知