Failed to load ApplicationContext

主要错误信息:
java.lang.IllegalStateException: Failed to load ApplicationContext

Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/tx]
Offending resource: class path resource [applicationContext.xml]

解决方法 :spring的jar包版本要和namespace中XSD版本对应

在pom.xml文件中改变jar的版本号

最终解决

原文地址:https://www.cnblogs.com/moumangtai/p/10657905.html

时间: 2024-11-13 06:39:38

Failed to load ApplicationContext的相关文章

java.lang.IllegalStateException: Failed to load ApplicationContext

1.错误描述 INFO:2015-02-05 22:14:21[main] - Loading XML bean definitions from class path resource [applicationContext.xml] INFO:2015-02-05 22:14:22[main] - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning INFO:2015-02-05

junit测试时,出现java.lang.IllegalStateException: Failed to load ApplicationContext

课程设计要求进行junit测试,我是在已经做好的ssh项目上做的测试,测试类代码如下 package com.zhang.web.services; import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; import javax.annotation.Resource; import org.junit.runner.RunWith; im

spring junit 做单元测试,报 Failed to load ApplicationContext 错误

spring junit 做单元测试,报 Failed to load ApplicationContext 错误. 查找了好一会,最后发现.@ContextConfiguration(locations = { "classpath:/spring/applicationContext.xml","classpath:/spring/app-config.xml", …… 改成 @ContextConfiguration(locations = { "c

spring中junit 提示Failed to load ApplicationContext

错误提示: 1:java.lang.IllegalStateException: Failed to load ApplicationContext 2:Error creating bean with name 'userService' defined in class path resource [UserService.xml]: Initialization of bean failed; nested exception is org.springframework.aop.fram

java.lang.IllegalStateException: Failed to load ApplicationContext(2)

错误提示:java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Error sett

常见Failed to load ApplicationContext异常解决方案!!

java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125) at org.springframework.test.context.suppo

SpringBoot报错:Failed to load ApplicationContext(javax.websocket.server.ServerContainer not available)

引起条件: WebSocket+单元测试,单元测试报错! 解决方法: SpringBootTest增加webEnvironment参数. https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html#boot-features-testing-spring-boot-applications @SpringBootTest(webEnvironment = SpringBootT

spring实战4 Failed to load ApplicationContext

今天看到spring的自动装配组件,照着书上的敲了下来报错了 代码: 接口 public interface CompactDisc { void play();} 实现类 import org.springframework.stereotype.Component; @Componentpublic class SgtPeppers implements CompactDisc { private String title = "命运交响曲"; private String art

小型SSM项目出现Failed to load ApplicationContext错误的解决方法(个人向)

使用单元测试的时候,出现了Failed to load ApplicationContext错误,在添加了一个新的Mapper.xml文件才出现的,在保证其他配置文件没有出错的情况下,检查mapper的id,是否重名,以及mapper文件报错,检查是否在SQL语句中出现<,>号,都要用 >  >  大于号 <  <  小于号 来替换 原文地址:https://www.cnblogs.com/Xjx-zhenCai/p/11398409.html