大家帮我看看,spring的配置文件哪里有问题?
我采用AbstractDependencyInjectionSpringContextTests进行测试,通过以下代码进行加载.
用原来的配置文件,可以顺利通过测试,改用新的后,就报以下错:
org.springframework.beans.factory.BeanDefinitionStoreException: Line 14 in XML document from class path resource [springapplicationcontext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
?at weblogic.apache.xerces.parsers.DOMParser.parse(DOMParser.java:271)
?at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201)
?at weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuilder.java:149)
?at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:76)
?at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:145)
?at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:99)
?at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:102)
?at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:70)
?at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:87)
?at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:262)
?at org.springframework.context.support.ClassPathXmlApplicationContext.<init></init>(ClassPathXmlApplicationContext.java:80)
?at org.springframework.context.support.ClassPathXmlApplicationContext.<init></init>(ClassPathXmlApplicationContext.java:65)
?at org.springframework.test.AbstractSpringContextTests.loadContextLocations(AbstractSpringContextTests.java:113)
?at org.springframework.test.AbstractDependencyInjectionSpringContextTests.loadContextLocations(AbstractDependencyInjectionSpringContextTests.java:147)
?at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:95)
?at org.springframework.test.AbstractDependencyInjectionSpringContextTests.setUp(AbstractDependencyInjectionSpringContextTests.java:114)
?at junit.framework.TestCase.runBare(TestCase.java:125)
?at junit.framework.TestResult$1.protect(TestResult.java:106)
?at junit.framework.TestResult.runProtected(TestResult.java:124)
?at junit.framework.TestResult.run(TestResult.java:109)
?at junit.framework.TestCase.run(TestCase.java:118)
?at junit.framework.TestSuite.runTest(TestSuite.java:208)
?at junit.framework.TestSuite.run(TestSuite.java:203)
?at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
?at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
?
1 楼 抛出异常的爱 2007-05-10 把配置文件上传。。。。用代码看不清那里错了。(被砍的七七八八) 2 楼 jun_fx 2008-05-01 小弟我不才,这几天也用aop搞事物。还算过了,看你的配置和我的配置,配置差不多,感觉你少写了一句话,打开对aop的支持。 o(∩_∩)o...。 我也是冇奏,你看看是不是。