java.lang.ClassNotFoundException: org/apache/crimson/parser/XMLReaderImpl

Discussion in 'Java' started by martin.wignall@gmail.com, Dec 21, 2005.

  1. Guest

    Hi,
    I've recently moved a web application running under Tomcat4.0.6, and
    java 4.0.2 to JBoss4.0.3 and java 5.0. The application works fine under
    Tomcat with java 4.0.2. However, I'm getting the exception
    "java.lang.ClassNotFoundException:
    org/apache/crimson/parser/XMLReaderImpl" being thrown from JBoss with
    java 5.0. The line of code in my application causing all the trouble
    is:

    XMLReader parser =
    XMLReaderFactory.createXMLReader("org.apache.crimson.parser.XMLReaderImpl");

    Now, this works fine in Tomcat with java 4.0.2, as java 4.0.2 includes
    the class org.apache.crimson.parser.XMLReaderImpl. See:
    http://java.sun.com/j2se/1.5.0/compatibility.html for the comment:

    "JAXP - The J2SE 1.4 platform included JAXP 1.1 ("Crimson"). The J2SE
    5.0 platform includes JAXP 1.3 ("Xerces"). Crimson and Xerces are not
    simply different versions of the same codebase. Instead, they are
    entirely different implementations of the JAXP standard. So, while they
    both conform to the JAXP standard, there are some subtle differences
    between them."

    However, java 5.0 does not include this class, and hence the problem.
    My question is therefore, what class do I need to use in place of
    org.apache.crimson.parser.XMLReaderImpl in order to make my application
    work with java 5.0?

    Many thnaks,
    Martin.
    , Dec 21, 2005
    #1
    1. Advertising

  2. Larry Guest

    Larry, Dec 21, 2005
    #2
    1. Advertising

  3. wrote:
    > Hi,
    > I've recently moved a web application running under Tomcat4.0.6, and
    > java 4.0.2 to JBoss4.0.3 and java 5.0. The application works fine under
    > Tomcat with java 4.0.2. However, I'm getting the exception
    > "java.lang.ClassNotFoundException:
    > org/apache/crimson/parser/XMLReaderImpl" being thrown from JBoss with
    > java 5.0. The line of code in my application causing all the trouble
    > is:
    >
    > XMLReader parser =
    > XMLReaderFactory.createXMLReader("org.apache.crimson.parser.XMLReaderImpl");
    >
    > Now, this works fine in Tomcat with java 4.0.2, as java 4.0.2 includes
    > the class org.apache.crimson.parser.XMLReaderImpl. See:
    > http://java.sun.com/j2se/1.5.0/compatibility.html for the comment:
    >
    > "JAXP - The J2SE 1.4 platform included JAXP 1.1 ("Crimson"). The J2SE
    > 5.0 platform includes JAXP 1.3 ("Xerces"). Crimson and Xerces are not
    > simply different versions of the same codebase. Instead, they are
    > entirely different implementations of the JAXP standard. So, while they
    > both conform to the JAXP standard, there are some subtle differences
    > between them."
    >
    > However, java 5.0 does not include this class, and hence the problem.
    > My question is therefore, what class do I need to use in place of
    > org.apache.crimson.parser.XMLReaderImpl in order to make my application
    > work with java 5.0?
    >
    > Many thnaks,
    > Martin.
    >


    Simply change your code to

    XMLReader parser = XMLReaderFactory.createXMLReader();

    J2SE 1.4 will use the Crimson classes with this coding
    and J2SE 5 will use the Xerces classes.

    Best,
    Manfred
    Manfred Rosenboom, Dec 22, 2005
    #3
  4. Guest

    Many thanks Manfred - that sounds ideal!
    , Dec 22, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page