Announcement Announcement Module
Collapse
No announcement yet.
Does Spring 1.1 depends on Xerces ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Does Spring 1.1 depends on Xerces ?

    Hi all,
    I am trying to run a HelloWorld application using Spring 1.1 rc2. I tried to load bean file like this
    BeanFactory factory = new XmlBeanFactory(new ClassPathResource("helloworld.xml"));

    it is giving the error
    javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found

    When I added Xerces to classpath it is working. It seems strange that Xerces is not distributed with Spring. Or am I making a mistake ?.

    rgds
    Antony Paul

  • #2
    At least you need any Xml-parser for spring (when you work with xml-based contexts). It appears that in your case Xerces seems to be looked for (maybe a fallback of spring if no other xml parser could be found?). Since JDK1.4 there should be Crimson available by default. So you do not need to do something particular (even if some people, including myself, prefer Xerces).

    You might choose the Xml-processor by specifying the VM property javax.xml.parsers.DocumentBuilderFactory.

    Regards,
    Andreas

    Comment


    • #3
      I am using Sun JDK 1.4. So by default it should take the system provided classes right.

      rgds
      Anto Paul

      Comment


      • #4
        Be careful if you are using some container (like Tomcat) what is the configuration - AFAIK, every major container has a topic inside their docs related to XML parsers - names and versions.

        Comment


        • #5
          It is a simple HelloWorld standalone application. Run using Ant 1.6.2.

          Comment


          • #6
            Then checkout the xml parsers available inside the Ant Classpaths - I had big problems running some application with Ant and the only solution was to put the XML parser inside the ANT LIB directory.
            The explanantion was that, even though the right XML parser was in the classpath, ANT was creating a vm for launching the app and gave only the ANT LIB as a classpath to it.

            Comment


            • #7
              Thanks Costin. I moved xercesImpl.jar and xml-apis.jar out of Ant lib directory and now it is working fine.

              rgds
              Antony Paul

              Comment


              • #8
                You're welcome. I think there are some properties which you can set but in my case they failed. Also the new versions of ant (latest is 1.6.5) I think are more flexible in this regard.

                Comment

                Working...
                X