开发者

SAXParseException when running Spring 3 JUnit

开发者 https://www.devze.com 2023-02-07 04:44 出处:网络
I just upgraded to Spring 3, and attempted to run some JUnits to make sure everything was copacetic. It wasn\'t. I got a SAXParseException when loading the context... it complained:

I just upgraded to Spring 3, and attempted to run some JUnits to make sure everything was copacetic. It wasn't. I got a SAXParseException when loading the context... it complained:

Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-2.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .

My suspicion is that it couldn't access the XSD due to proxy configuration. Is there a way to make it stop trying so hard to validate it and just run the darn thing? :)

In all serious开发者_开发技巧ness, though, I didn't have a problem when I was running under Spring 2, so I suspect that Spring 2 didn't bother to try to validate, but Spring 3 does. I was hoping there was a way to bypass that functionality.

One further clue... Since I couldn't run the JUnits, I went ahead and fired up the server (this is a web app), and everything seemed to go swimmingly. So that makes me think that Spring is just fine with my context files as they are.

Edit The same error occurs when using instead the Spring 3.0 schemas


It could be because you are using xsd of spring 2. You could try using http://www.springframework.org/schema/beans/spring-beans-3.0.xsd.


As it turns out, my problem was a result of re-bundling the spring jars into a single jar. Just using the separate jars worked fine for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消