Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 33425 invoked from network); 8 Aug 2006 07:16:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Aug 2006 07:16:14 -0000 Received: (qmail 66768 invoked by uid 500); 8 Aug 2006 07:16:13 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 65762 invoked by uid 500); 8 Aug 2006 07:16:10 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 65751 invoked by uid 99); 8 Aug 2006 07:16:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 00:16:10 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of avadhanula@gmail.com designates 66.249.82.232 as permitted sender) Received: from [66.249.82.232] (HELO wx-out-0506.google.com) (66.249.82.232) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 00:16:08 -0700 Received: by wx-out-0506.google.com with SMTP id s8so38358wxc for ; Tue, 08 Aug 2006 00:15:47 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; b=bQMMooRf2bUCxxzBW0XEJ9RJukEhzeGLHPuVdXk8gv5A9ixN//giGz1M+S77aKthHZSKhH/jQh2QtLn/BsMx4ZsIncG5RdNc/AO5x6BNxk72vj14R6RF/+2eujpZ0CD4XSvRwl2FKlooGDY0ZFHIpoW90JVM0sVoUOTN9Poqvbg= Received: by 10.70.102.5 with SMTP id z5mr352148wxb; Tue, 08 Aug 2006 00:15:47 -0700 (PDT) Received: from ?192.168.1.134? ( [207.38.254.62]) by mx.gmail.com with ESMTP id 5sm4522848wrh.2006.08.08.00.15.47; Tue, 08 Aug 2006 00:15:47 -0700 (PDT) Message-ID: <44D83A19.1050807@gmail.com> Date: Tue, 08 Aug 2006 03:15:37 -0400 From: Suresh Avadhanula User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: user@ant.apache.org Subject: XSL Extensions inside ant Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I have created a custom ant task that executes an XSL which has extensions. The XSL is attached below. I placed the latest xalan ( xalan-j 2.7.0 ), xercesImpl, xml-api and serializer jars in ANT_HOME/lib. I am using JDK 1.5. It works fine using command line. But when I execute the task from ant, I get the following error. Any help is greatly appreciated. generateModel: [modelGen] Generate Model [modelGen] hibernateFile is model.xml [modelGen] ************* Transformering ************* [modelGen] hibernateFile model.xml [modelGen] destFile ufs-hibernate-mapping.hbm.xml [modelGen] file:///C:/cygwin/home/suresh/dev/javatest/xsl/generateModel.xsl; Line #35; Column #35; javax.xml.transform.TransformerException: java.lan g.ClassNotFoundException: com.gandeev.transformer.ModelExtensions [modelGen] file:///C:/cygwin/home/suresh/dev/javatest/xsl/generateModel.xsl; Line #47; Column #67; java.lang.NoSuchMethodException: For extension fun ction, could not find method org.apache.xml.utils.NodeVector.getBaseClass([ExpressionContext,] ). [modelGen] file:///C:/cygwin/home/suresh/dev/javatest/xsl/generateModel.xsl; Line #47; Column #67; java.lang.NullPointerException [modelGen] ************* Result ************* ---- The Ant Task file public class ModelGen extends Task { private final static String styleName = "generateModel.xsl"; private String hibernateFile = null; private String destFile = null; private String srcDir = null; public ModelGen() { } public void setHibernateFile(String hibernateFile) { this.hibernateFile = hibernateFile; } public String getHibernateFile() { return this.hibernateFile; } public void setDestFile(String destFile) { this.destFile = destFile; } public String getDestFile() { return this.destFile; } public void setSrcDir ( String srcDir) { this.srcDir = srcDir; } public String getSrcDir () { return this.srcDir; } public void execute() throws BuildException { if (hibernateFile == null) throw new BuildException(" Hibernate file not specified"); if (destFile == null) throw new BuildException(" Dest Dir not specified"); if (srcDir == null) throw new BuildException(" src Dir not specified"); System.out.println("Generate Model"); String filename = null; try{ TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new StreamSource(styleName)); transformer.setParameter("src.dir", "c:/cygwin/home/suresh/dev/gandeev/ufs"); System.out.println("************* Transformering *************"); System.out.println ("hibernateFile "+ hibernateFile); System.out.println ("destFile "+ destFile); transformer.transform(new StreamSource(hibernateFile), new StreamResult(new FileOutputStream(destFile))); System.out.println("************* Result *************"); } catch (Exception e) { e.printStackTrace(); } } public static void main (String[] args) { try { ModelGen modelGen = new ModelGen(); modelGen.setDestFile("main.xml"); modelGen.setSrcDir("c:/cygwin/home/suresh/dev/gandeev/ufs"); modelGen.setHibernateFile("model.xml"); modelGen.execute(); } catch (Exception e) { e.printStackTrace(); } } } Thanks Suresh --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org