请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Failed to load ApplicationContext这个问题怎么解决

9月 08, 2019 1:40:30 下午 org.springframework.test.context.support.DefaultTestContextBootstrapper getDefaultTestExecutionListenerClassNames
信息: Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
9月 08, 2019 1:40:30 下午 org.springframework.test.context.support.DefaultTestContextBootstrapper getTestExecutionListeners
信息: Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@21a947fe, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@5606c0b, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@80ec1f8, org.springframework.test.context.support.DirtiesContextTestExecutionListener@1445d7f, org.springframework.test.context.transaction.TransactionalTestExecutionListener@6a396c1e, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@6c3f5566]
9月 08, 2019 1:40:30 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [spring/spring-dao.xml]
9月 08, 2019 1:40:43 下午 org.springframework.test.context.TestContextManager prepareTestInstance
严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@80ec1f8] to prepare test instance [com.imooc.o2o.dao.AreaDaoTest@3c19aaa5]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunnerKaTeX parse error: Expected 'EOF', got '文' at position 1261: …umnNumber: 69; 文̲档根元素 "beans" 必须…ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1292)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImplFragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3063)atjava.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImplFragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3063) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImplFragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3063)atjava.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImplPrologDriver.next(XMLDocumentScannerImpl.java:836)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:429)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391)
… 38 more

正在回答 回答被采纳积分+3

1回答

翔仔 2019-09-08 20:04:11

同学好,

at org.junit.runners.ParentRunnerKaTeX parse error: Expected 'EOF', got '文' at position 1261: …umnNumber: 69; 文̲档根元素 "beans" 必须…ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1292)

还是你的Spring-dao.xml或者mapper配置有问题导致xml解析失败,请仔细与视频比对一下

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信