Menu

Ant and Jelly Please Help

Help
beuveda
2007-02-19
2013-04-25
  • beuveda

    beuveda - 2007-02-19

    I have the following script called 'antUseSample.xml'

    <j:jelly xmlns:j="jelly:core" xmlns:ant="jelly:ant">

    <ant:echo>
    HELLO
    </ant:echo>

    </j:jelly>

    On windows, I launch a DOS box, I enter the command 'ant build test.script -Dscript=antUseSample.xml' using the build.xml given with jameleon and I receive

    [jmln-test-vm] Executing: C:\Daniel\workspaces\jameleon\MID_Test\scripts\antUseSample.xml
    [jmln-test-vm] java.lang.ClassNotFoundException: ant
    [jmln-test-vm]  at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    [jmln-test-vm]  at java.security.AccessController.doPrivileged(Native Method)
    [jmln-test-vm]  at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    [jmln-test-vm]  at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    [jmln-test-vm]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    [jmln-test-vm]  at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    [jmln-test-vm]  at org.apache.commons.jelly.parser.XMLParser.createTag(XMLParser.java:985)
    [jmln-test-vm]  at org.apache.commons.jelly.parser.XMLParser.startElement(XMLParser.java:593)
    [jmln-test-vm]  at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    [jmln-test-vm]  at org.apache.commons.jelly.parser.XMLParser.parse(XMLParser.java:254)
    [jmln-test-vm]  at org.apache.commons.jelly.JellyContext.compileScript(JellyContext.java:545)
    [jmln-test-vm]  at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:680)
    [jmln-test-vm]  at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:670)
    [jmln-test-vm]  at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:579)
    [jmln-test-vm]  at net.sf.jameleon.ExecuteTestCase.runScript(ExecuteTestCase.java:271)
    [jmln-test-vm]  at net.sf.jameleon.ExecuteTestCase.executeJellyScript(ExecuteTestCase.java:237)
    [jmln-test-vm]  at net.sf.jameleon.ExecuteTestCase.execute(ExecuteTestCase.java:210)
    [jmln-test-vm]  at net.sf.jameleon.ExecuteTestCase.executeFiles(ExecuteTestCase.java:222)
    [jmln-test-vm]  at net.sf.jameleon.ExecuteTestCase.main(ExecuteTestCase.java:169)
    [jmln-test-vm] java.lang.ClassNotFoundException: ant
    [jmln-test-vm]  at org.apache.commons.jelly.parser.XMLParser.createSAXException(XMLParser.java:1185)
    [jmln-test-vm]  at org.apache.commons.jelly.parser.XMLParser.createTag(XMLParser.java:990)
    [jmln-test-vm]  at org.apache.commons.jelly.parser.XMLParser.startElement(XMLParser.java:593)
    [jmln-test-vm]  at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    [jmln-test-vm]  at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    [jmln-test-vm]  at org.apache.commons.jelly.parser.XMLParser.parse(XMLParser.java:254)
    [jmln-test-vm]  at org.apache.commons.jelly.JellyContext.compileScript(JellyContext.java:545)
    [jmln-test-vm]  at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:680)
    [jmln-test-vm]  at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:670)
    [jmln-test-vm]  at org.apache.commons.jelly.JellyContext.runScript(JellyContext.java:579)
    [jmln-test-vm]  at net.sf.jameleon.ExecuteTestCase.runScript(ExecuteTestCase.java:271)
    [jmln-test-vm]  at net.sf.jameleon.ExecuteTestCase.executeJellyScript(ExecuteTestCase.java:237)
    [jmln-test-vm]  at net.sf.jameleon.ExecuteTestCase.execute(ExecuteTestCase.java:210)
    [jmln-test-vm]  at net.sf.jameleon.ExecuteTestCase.executeFiles(ExecuteTestCase.java:222)
    [jmln-test-vm]  at net.sf.jameleon.ExecuteTestCase.main(ExecuteTestCase.java:169)
    [jmln-test-vm] The following test cases failed:
    [jmln-test-vm] _______________________________________________________________
    [jmln-test-vm] C:\Daniel\workspaces\jameleon\MID_Test\scripts\antUseSample.xml
    [jmln-test-vm] -------------------------------------------------------------
    [jmln-test-vm] CAUSE:
    [jmln-test-vm] Could not parse Jelly script

    Can you tell me what's missing

    Thank you in advance

     
    • Christian Hargraves

      The "java.lang.ClassNotFoundException: ant" looks like there's a high probability you need the Jelly Ant libraries.

      To get this, go to the Jelly site (http://jakarta.apache.org/commons/jelly/), click on the "Tag Libraries" link and go the tag library you are interested in "ant" (http://jakarta.apache.org/commons/jelly/libs/ant/index.html).

      Select the latest download version and place the required jars in the lib directory.

       
    • beuveda

      beuveda - 2007-02-19

      Thank you it worked.

      I downloaded commons-jelly-tags-ant-1.1.jar from the jelly site but I also had to add the ant-junit.jar file from the ant distribution into the lib directory

       

Log in to post a comment.