Spring Tip : how to reference local xsd file.

Got this exception when I changed the spring configuration file from using dtd to xsd,

SRVE0100E: Did not realizeĀ  init() exception thrown by servlet dispatcher: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 4 in XML document from ServletContext resource [/WEB-INF/dispatcher-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element ‘beans’.
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element ‘beans’.
Had to google around for some time to find a solution. The original solution is written here.

This works!. Just elaborating what i did on Websphere 6.1 server to solve this…

Extract the spring.jar file to a temp directory and take the META-INF directory from it.

Delete the existing MANIFEST.MF file and created a new jar “spring-schemas.jar” with just the META-INF directory as content.

Now, On Websphere admin console.. goto..

Environments > Shared Libraries

and create a new one named SPRING_SCHEMA pointing to spring-schemas.jar.

Now add this library to the server at

Application servers > server1 > Class loader > Classloader_1203675889577 > Library Reference

That’s it. Restart the server and the error should be gone.

2 Comments »

  1. ELena said

    Hello, I am in the same situation, but with jboss as server. But I don’t understand the explanation. I must extract spring.jar, ok. Inside META-INf is Manifest.mf, and I must delete it, ok. Inside the META-INF directory I must create one file named spring-schemas.jar. ok. And then? I dont urderstand you. What must I do with META-INF directory? Please, can you explain me it in detail? Thanks, regards

    Elena

  2. I should email u about it.

RSS feed for comments on this post · TrackBack URI

Leave a Comment