Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5031455

NoSuchMethodError is thrown during XPathException object creation

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.3
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description



        Name: eaR10174 Date: 04/14/2004



        NoSuchMethodError is thrown during creation of an instance of XPathException. This
        error is thrown when jaxp-1.3-beta-b14 build 12_apr_2004 is used with jdk1.3.1.

        The sample is provided below; it fails on JDK 1.3.1.
        ------------------------------------test.java-----------------------------
        import javax.xml.xpath.XPathException;

        public class test {

            public static void main(String [] args) {
                XPathException exc = new XPathException(new Exception("q"));
                System.out.println("OK");
            }
        }
        --------------------------------------------------------------------------
        % echo $CLASSPATH; java -showversion test
        /export/ld50/java/products/sun/JAXP/jaxp-1.3-beta-b14-12_apr_2004/dom.jar:
        /export/ld50/java/products/sun/JAXP/jaxp-1.3-beta-b14-12_apr_2004/jaxp-api.jar:
        /export/ld50/java/products/sun/JAXP/jaxp-1.3-beta-b14-12_apr_2004/sax.jar:
        /export/ld50/java/products/sun/JAXP/jaxp-1.3-beta-b14-12_apr_2004/xalan.jar:
        /export/ld50/java/products/sun/JAXP/jaxp-1.3-beta-b14-12_apr_2004/xercesImpl.jar
        java version "1.3.1"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
        Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

        Exception in thread "main" java.lang.NoSuchMethodError
        at javax.xml.xpath.XPathException.<init>(XPathException.java:50)
        at test.main(test.java:6)
        --------------------------------------------------------------------------

        The bug affects the new JAXP TCK 1.3 tests which pass on jdk1.5.0-beta2-b46:

          api/javax_xml/xpath/XPath/index.html#Compile[Compile002]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate007]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate008]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate009]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate029]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate030]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate031]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate032]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate036]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate039]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate040]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate041]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate043]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate044]
          api/javax_xml/xpath/XPath/index.html#Evaluate[Evaluate045]
          api/javax_xml/xpath/XPathException/index.html#Ctor
          api/javax_xml/xpath/XPathExpression/index.html#Evaluate[Evaluate007]
          api/javax_xml/xpath/XPathExpression/index.html#Evaluate[Evaluate008]
          api/javax_xml/xpath/XPathExpression/index.html#Evaluate[Evaluate028]
          api/javax_xml/xpath/XPathExpression/index.html#Evaluate[Evaluate030]
          api/javax_xml/xpath/XPathExpression/index.html#Evaluate[Evaluate034]
          api/javax_xml/xpath/XPathExpression/index.html#Evaluate[Evaluate036]
          api/javax_xml/xpath/XPathExpression/index.html#Evaluate[Evaluate037]
          api/javax_xml/xpath/XPathExpression/index.html#Evaluate[Evaluate041]
          api/javax_xml/xpath/XPathExpression/index.html#Evaluate[Evaluate042]
          api/javax_xml/xpath/XPathExpressionException/index.html#Ctor
          api/javax_xml/xpath/XPathFactoryConfigurationException/index.html#Ctor
          api/javax_xml/xpath/XPathFunctionException/index.html#Ctor


        ======================================================================

        Name: eaR10174 Date: 06/11/2004



        The constructor XPathException(Throwable) throws NoSuchMethodError because it calls
        the superclass constructor Exception(Throwable) and in jdk1.3.1 the Exception class
        does not have the constructor Exception(Throwable). It looks like that JAXP 1.3
        classes are built by the jdk1.4 compiler. Note that the sample provided is compiled
        successfully on jdk1.3 with jaxp-1.3-beta-b18-09_jun_2004.

        So this JAXP 1.3 constructor of XPathException can not be used on jdk1.3 as it uses
        API from jdk1.4


        ======================================================================

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                kkawagucsunw Kohsuke Kawaguchi (Inactive)
                Reporter:
                evgsunw Evg Evg (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: