Help resolving NoSuchMethodError

Discussion in 'Java' started by laredotornado, Jan 29, 2010.

  1. Hi,

    I'm trying to write some JUnit (3.8.1) tests using Maven (1.1, can't
    upgrade now), and Java 1.5. In my Maven dependency list, I have

    <dependency>
    <groupId>xalan</groupId>
    <artifactId>xalan</artifactId>
    <version>2.7.0</version>
    </dependency>

    And when I run my test, it dies with ...

    org.apache.xpath.compiler.FunctionTable.installFunction(Ljava/lang/
    String;Ljava/lang/Class;)I
    java.lang.NoSuchMethodError:
    org.apache.xpath.compiler.FunctionTable.installFunction(Ljava/lang/
    String;Ljava/lang/Class;)
    at
    com.gargoylesoftware.htmlunit.html.xpath.XPathAdapter.initFunctionTable
    (XPathAdapter.java:52)
    at com.gargoylesoftware.htmlunit.html.xpath.XPathAdapter.<init>
    (XPathAdapter.java:68)
    at
    com.gargoylesoftware.htmlunit.html.xpath.XPathUtils.evaluateXPath
    (XPathUtils.java:128)
    at
    com.gargoylesoftware.htmlunit.html.xpath.XPathUtils.getByXPath
    (XPathUtils.java:72)
    at
    com.gargoylesoftware.htmlunit.javascript.host.HTMLCollection.computeElements
    (HTMLCollection.java:245)
    at
    com.gargoylesoftware.htmlunit.javascript.host.HTMLCollection.getElements
    (HTMLCollection.java:232)
    at
    com.gargoylesoftware.htmlunit.javascript.host.HTMLCollection.getWithPreemption
    (HTMLCollection.java:323)


    Somehow an older version of the xalan method is getting called (from
    an earlier version than 2.7) but I can't figure out where in my system
    it is getting loaded. I have done a search in my system for all xalan
    jar files and I can't find any in my classpath. What advice do you
    have for troubleshooting this problem and finding out how the old
    classes are getting loaded?

    Thanks, - Dave
     
    laredotornado, Jan 29, 2010
    #1
    1. Advertising

  2. laredotornado

    Sherkan Guest

    it looks like you don't have some jar library.
    Check all your jars if there is such an method
     
    Sherkan, Jan 29, 2010
    #2
    1. Advertising

  3. laredotornado

    Arne Vajhøj Guest

    On 29-01-2010 11:16, laredotornado wrote:
    > I'm trying to write some JUnit (3.8.1) tests using Maven (1.1, can't
    > upgrade now), and Java 1.5. In my Maven dependency list, I have
    >
    > <dependency>
    > <groupId>xalan</groupId>
    > <artifactId>xalan</artifactId>
    > <version>2.7.0</version>
    > </dependency>
    >
    > And when I run my test, it dies with ...
    >
    > org.apache.xpath.compiler.FunctionTable.installFunction(Ljava/lang/
    > String;Ljava/lang/Class;)I
    > java.lang.NoSuchMethodError:
    > org.apache.xpath.compiler.FunctionTable.installFunction(Ljava/lang/
    > String;Ljava/lang/Class;)


    > Somehow an older version of the xalan method is getting called (from
    > an earlier version than 2.7) but I can't figure out where in my system
    > it is getting loaded. I have done a search in my system for all xalan
    > jar files and I can't find any in my classpath. What advice do you
    > have for troubleshooting this problem and finding out how the old
    > classes are getting loaded?


    System.out.println(org.apache.xpath.compiler.FunctionTable.class.getProtectionDomain().getCodeSource());

    somewhere in the code.

    Arne
     
    Arne Vajhøj, Jan 30, 2010
    #3
    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