Menu

Dumb problem

2003-11-06
2003-11-11
  • Vladimir Ritz Bossicard

    I'm sure it's obvious, but sorry, I can't see it.

    I try to write a dummy xsl stylesheet and run it with ejen-1.1.  Here the xsl:

    <xsl:stylesheet
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:ver="org.ejen.ext.Version"
        version="1.0">

      <xsl:output method="text" encoding="iso-8859-1"/>

         <xsl:template match="table">
             Ejen version <xsl:value-of select="ver:toString()"/>
        </xsl:template>

    </xsl:stylesheet>

    As you can see, it's the _same_ stuff as in the various examples provides with ejen.  When I try to run it:

    [javax.xml.transform.TransformerException] {
      message: Instance method call to method toString requires an Object instance as first argument
    }

    sorry I don't get it.  What's the problem here?

    Thanks,

    -Vladimir

     
    • Franck Wolff

      Franck Wolff - 2003-11-06

      Hi,

      I cannot reproduce your problem... Few questions:
      - what is your j2sdk version (java -version) ?
      - what is your system (linux, windows, ...) ?
      - did you put anything into your "endorsed" directory ?
      - what is complete stacktrace when you add stacktrace="true" in ejen node (in your ant build file) ?

      I mean: <ejen stacktrace="true">...</ejen>

      I believe this is a xalan version problem but I need further informations.

      Regards,

      Franck.

       
    • Vladimir Ritz Bossicard

      I have a _vanilla_ installation of ejen-1.1 and jdk-1.4.2_02 (the latest version from Sun) and I'm running on Linux (RedHat 9).  As you pointed out, it's certainly a Xalan problem.

      I want to avoid putting anything into the "endorsed" library just for fixing ejen so if you have other suggestions (that can be used in the Ant build script), I'm all ears.

      And here's the stack trace that I got, running my sample program:

      [javax.xml.transform.TransformerException] {
        stack-trace: javax.xml.transform.TransformerException: Instance method call to method toString requires an Object instance as first argument
              at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:355)
              at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:227)
              at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:461)
              at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:233)
              at org.apache.xpath.Expression.executeCharsToContentHandler(Expression.java:357)
              at org.apache.xalan.templates.ElemValueOf.execute(ElemValueOf.java:319)
              at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2339)
              at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160)
              at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213)
              at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:668)
              at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1129)
              at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1107)
              at org.ejen.EjenTemplateNode.process(EjenTemplateNode.java:98)
              at org.ejen.EjenNode.processChildNodes(EjenNode.java:336)
              at org.ejen.EjenForeachNode.process(EjenForeachNode.java:80)
              at org.ejen.EjenNode.processChildNodes(EjenNode.java:336)
              at org.ejen.EjenRootNode.process(EjenRootNode.java:94)
              at org.ejen.ant.Ejen.execute(Ejen.java:405)
              at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
              at org.apache.tools.ant.Task.perform(Task.java:341)
              at org.apache.tools.ant.Target.execute(Target.java:309)
              at org.apache.tools.ant.Target.performTasks(Target.java:336)
              at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
              at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
              at org.apache.tools.ant.Main.runBuild(Main.java:609)
              at org.apache.tools.ant.Main.start(Main.java:196)
              at org.apache.tools.ant.Main.main(Main.java:235)

      Merci pour le support,

      -Vladimir

       
    • Franck Wolff

      Franck Wolff - 2003-11-08

      I have just installed jdk-1.4.2_02 and, again, I cannot reproduce your problem... There is however a ';' in your source code (after the xsl namespace declaration) that causes a parse exception.

      I'm running an other Linux distribution (Mandrake-9.1) but it shouldn't change anything. So...

      BTW, you may use a -Xbootclasspath/p: option when you start the jvm (instead of adding jars in your "endorsed" directory). Try something like:

      java -Xbootclasspath/p:$EJEN_HOME/lib/xalan.jar -classpath ...

      Pas de quoi, Franck.

       
      • Vladimir Ritz Bossicard

        After some trials/errors and a lot of browsing the examples, I found out that I had to place ejen.jar and resolver.jar into my ant/lib directory.

        The difference with the examples provided by ejen is that they all call the ejen-env script and this script simply set the correct classpath.  But it won't work if you simply call ant -buildfile generate.xml (which should be the normal case, since your production code won't be placed in the ejen's example folder).

        The solution to this problem (according to the Ant doc) is to let the ejen task support the classpath.

        That should solve the problem.

        -Vladimir

         

Log in to post a comment.