Results 1 to 8 of 8

Thread: Does Spring 1.1 depends on Xerces ?

  1. #1
    Join Date
    Oct 2004
    Location
    India
    Posts
    7

    Default 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. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    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

  3. #3
    Join Date
    Oct 2004
    Location
    India
    Posts
    7

    Default

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

    rgds
    Anto Paul

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5
    Join Date
    Oct 2004
    Location
    India
    Posts
    7

    Default

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

  6. #6
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  7. #7
    Join Date
    Oct 2004
    Location
    India
    Posts
    7

    Default

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

    rgds
    Antony Paul

  8. #8
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Replies: 5
    Last Post: Aug 9th, 2008, 05:30 AM
  3. Gaijin Studio for Spring MVC 0.9.2 Released
    By dadams in forum Announcements
    Replies: 8
    Last Post: May 30th, 2007, 10:48 PM
  4. A Spring Class Loader?
    By azzoti in forum Architecture
    Replies: 8
    Last Post: May 7th, 2005, 04:02 AM
  5. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •