You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Joel Eddy <jo...@radsoft.com> on 2001/02/15 23:47:25 UTC

interesting error

     Hello,

        I am getting the following error when I try to run a simple Tranformation app, pulled right off the web site :)

     [java] java.lang.NoSuchMethodError
     [java]     at org.apache.xpath.DOM2Helper.getLocalNameOfNode(DOM2Helper.java

The code I am trying to get to work is below. 
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(new StreamSource("/picklist.xsl"));
    transformer.transform(new StreamSource("/test.xml"), new StreamResult  (new FileOutputStream("/picklist.fo")));


It works in different environments.  The only differences that I can see are minor differences in the classpath.  For example, it works with the following command line arguments.

C:\cvs\web\webapp>java -classpath "c:\cvs\web\build\jbuilder\classes;c:\cvs\web
\lib\xml\xalan.jar;c:\cvs\web\lib\xml\xerces.jar" com.orbus.web.reporting.TestXSL

It runs fine and creates the expected picklist.fo file in c:\. However, when I run it as part of a batched testing application with JUnit, it fails with the error at the top of this email. Xerces and Xalan are in the classpath as well as jaxp.jar, jaxp11.jar, crimson.jar, etc..... We tried putting Xerces and Xalan and the beginning of the classpath, but this didn't help.

If you have any tips please let me know.

Thanks,

Joel Eddy

Re: interesting error

Posted by Gary L Peskin <ga...@firstech.com>.
> Joel Eddy wrote:
> 
>      Hello,
> 
>         I am getting the following error when I try to run a simple
> Tranformation app, pulled right off the web site :)
> 
>      [java] java.lang.NoSuchMethodError
>      [java]     at
> org.apache.xpath.DOM2Helper.getLocalNameOfNode(DOM2Helper.java
> 
> ...
>
> It works in different environments.  The only differences that I can
> see are minor differences in the classpath.  For example, it works
> with the following command line arguments.
> 
> C:\cvs\web\webapp>java -classpath
> "c:\cvs\web\build\jbuilder\classes;c:\cvs\web
> \lib\xml\xalan.jar;c:\cvs\web\lib\xml\xerces.jar"
> com.orbus.web.reporting.TestXSL
> 
> It runs fine and creates the expected picklist.fo file in c:\.
> However, when I run it as part of a batched testing application with
> JUnit, it fails with the error at the top of this email. Xerces and
> Xalan are in the classpath as well as jaxp.jar, jaxp11.jar,
> crimson.jar, etc..... We tried putting Xerces and Xalan and the
> beginning of the classpath, but this didn't help.

The problem is indeed due to jaxp.jar, jaxp11.jar, crimson.jar, or some
other DOM classes being in the search order ahead of xerces and xalan. 
Check your lib/ext directory to see if any of the jars are in there. 
Those will get searched first.  If the jars are in there, rename them or
move them out.

HTH,
Gary