ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Changing Date format
Date Thu, 30 Nov 2006 13:01:35 GMT
1. As I wrote - that's pseudocode. Means: you have to fix a little bit
   (like the >>while(line = in.readLine())<< statement - you cant iterate over
a java.io.File)
2. It seems you havent installed all required libraries. 
   Does the BSF have a dependency on commons-logging now? Then we have to note that on
   /manual/install.html#librarydependencies ...

Jan


>-----Urspr√ľngliche Nachricht-----
>Von: Pritesh Saharey [mailto:pritesh.saharey@wipro.com] 
>Gesendet: Donnerstag, 30. November 2006 13:40
>An: 'Ant Users List'
>Betreff: RE: Changing Date format
>
>
>Thanks for quick reply, but when I tried to use the code like this:
>
>//----------------------------------------------
><target name="chg-date">
>    <scriptdef name="dateConvert" language="javascript">
>        <attribute name="in"/>
>        <attribute name="out"/>
>        <![CDATA[
>            in  = new java.io.File(attributes.get("in"));
>            out = new java.io.File(attributes.get("out"));
>            fIn  = new java.text.SimpleDateFormat("yyyy/MM/dd");
>            fOut = new java.text.SimpleDateFormat("MMM dd, yyyy");
>            while(line = in.readLine()) {
>		    out.writeln( fOut.format( fIn.parse(line) ));
>            }
>            in.close(); 
>            out.close();
>        ]]>
>    </scriptdef> 
>    <dateConvert in="D:/LFCG/data" out="Datachange"/>
>    </target>
>//----------------------------------------------
>When I tried running my build file, it's giving me logging error
>
>//-------------------------------------------------
>BUILD FAILED
>java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
>        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)
>        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>        at org.apache.tools.ant.Main.runBuild(Main.java:668)
>        at org.apache.tools.ant.Main.startAnt(Main.java:187)
>        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
>        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
>Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
>        at org.apache.bsf.BSFManager.<init>(BSFManager.java:102)
>        at org.apache.tools.ant.util.ScriptRunner.executeScript(ScriptRunner.java:111)
>        at org.apache.tools.ant.taskdefs.optional.script.ScriptDef.executeScript(ScriptDef.java:317)
>        at org.apache.tools.ant.taskdefs.optional.script.ScriptDefBase.execute(ScriptDefBase.java:47)

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message