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

时间: 2024-09-29 02:21:10

java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException的相关文章

Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError:org/springframework/beans/factory/config/EmbeddedValueResoler

我是在运行一个spring-mybatis小案例时遇到这个错误,已经解决,在这里记录和分享给你们 报错截图如下: 解决方法:检查发现spring的核心包spring-bean版本和其他核心包版本不同,更改为和其他核心包相同的版本即可 这类报错引起的原因还有一些,这只是一种解决方法供参考! 原文地址:https://www.cnblogs.com/quanbin/p/11100337.html

Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/ServletRegistrationBean

异常信息 2017-09-02 18:06:37.223 [main] ERROR o.s.boot.SpringApplication - Application startup failed java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$Endpoint

Spring出现Unexpected exception parsing XML document from class path resource [applicationBeans.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/TargetSource异常

在自学Spring4的过程中,遇到了棘手的异常,一直找不到问题所在,后来经过对每个过程进行逐一排查之后,发现少了一个jar包:spring-aop-4.0.0.RELEASE.jar.完整的异常信息如下: Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from clas

java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy

问题:Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext-dao.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptio

缺jar包异常:java.lang.NoClassDefFoundError: org/springframework/core/convert/support/PropertyTypeDescriptor

严重: StandardWrapper.Throwable java.lang.NoClassDefFoundError: org/springframework/core/convert/support/PropertyTypeDescriptor at org.springframework.beans.PropertyAccessorFactory.forBeanPropertyAccess(PropertyAccessorFactory.java:37) at org.springfra

java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext

***************************错误提示************************************************ SEVERE: A child container failed during start java.util.concurrent.ExecutionException:org.apache.catalina.LifecycleException: Failed to start component[StandardEngine[Cat

Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext

1.错误描述 严重: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/smp]] at java.util.concurre

Maven Web项目 java.lang.NoClassDefFoundError: org/springframework/core/NestedRuntimeException错误

导读 使用Eclipse在从SVN或从git中check out Web项目后,运行可能会出现 java.lang.NoClassDefFoundError:org/springframework/core/NestedRuntimeException错误.检查Maven Dependencies后,发现org.springframework.core.NestedRuntimeException类就在Spring-core jar包里,系统怎么会没发现这个类呢?这时候就要考虑Maven Dep

Webservice报错java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefinitionRead

用spring集成发布一个Webservice服务,老是报错: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setValidationMode(I)V at org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.<init>(XBeanXmlBeanDefinitionReader.j