Announcement Announcement Module
No announcement yet.
What jar files should I need in order to use XMLBeanFactory? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • What jar files should I need in order to use XMLBeanFactory?

    I am using spring framework v1.2.3 and I am trying to use XMLBeanFactory to create a simple bean. I includes the following jar files in my classpath: spring.jar, commons-logging.jar.But I got the following exception:

    Exception in thread "main" java.lang.NoClassDefFoundError: org/xml/sax/SAXExcept
    at org.springframework.beans.factory.xml.XmlBeanFacto ry.<init>(XmlBeanFa
    at org.springframework.beans.factory.xml.XmlBeanFacto ry.<init>(XmlBeanFa

    Please advise how to solve this problem. Thanks a lot.

  • #2
    My guess is that you are using a jvm version before 1.4, because SAXException is part of the standard java library in 1.4/5.0. My bet is that it works if you add the Xerces xml parser library (the class can be found in that jar)


    • #3
      As mentioned, J2SE 1.4+ comes with a built-in parser (Crimson), and there should be no need to bundle another parser with your app just so Spring can read an XML config file. In JDK 1.3 and before, you need to incldue something like Xerces. Note that there are some lighter-weight alternatives to Xerces, which is pretty capable but also pretty big.