Results 1 to 3 of 3

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

  1. #1
    Join Date
    Jun 2005
    Posts
    8

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

    Hello,
    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
    ion
    at org.springframework.beans.factory.xml.XmlBeanFacto ry.<init>(XmlBeanFa
    ctory.java:47)
    at org.springframework.beans.factory.xml.XmlBeanFacto ry.<init>(XmlBeanFa
    ctory.java:56)

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

  2. #2
    Join Date
    Nov 2004
    Location
    Hilversum - The Netherlands
    Posts
    1,054

    Default

    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. #3
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    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.
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

Similar Threads

  1. Reading xml beans files from jar files problem !!!
    By p_e_t_e_r in forum Container
    Replies: 10
    Last Post: Sep 26th, 2005, 12:38 AM
  2. hibernate pagination
    By oliverchua in forum Data
    Replies: 8
    Last Post: Sep 23rd, 2005, 06:06 PM
  3. Replies: 3
    Last Post: Jun 19th, 2005, 04:53 PM
  4. Loading Beans in Order
    By mallupappi in forum Container
    Replies: 2
    Last Post: Mar 31st, 2005, 07:23 AM
  5. Unexpected behaviour with multiple config files
    By rgitzel in forum Container
    Replies: 7
    Last Post: Mar 8th, 2005, 07:11 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
  •