I haven't yet reduced this down to a simple test case, so I won't file a bug yet (and it could be a problem with ant 1.6), but with one of my build files, I am using the VPP task (pretty much as illustrated in the examples) to generate some files. Works fine on ant 1.5.3, but doesn't work on ant 1.6b2. The stack trace in dicates a null pointer on VPPFilter.prepreprocess(), on the line:
This is the whole exception below. (Don't mind the line numbers in VPPFilter; I added some debugging of my own to track it down). Notice that it goes through preprocess twice. With the debugging added and ant 1.5.3, it does not run preprocess twice; just once. With ant 1.6, the first time the reference to fileUtils looks okay; the 2nd time through it's null and the null pointer occurs:
Tue Nov 04 09:51:01 PST 2003 [error] Parser Error: vpp : java.lang.NullPointerException
at foundrylogic.vpp.VPPFilter.preprocess(VPPFilter.java:219)
at foundrylogic.vpp.VPPFilter.read(VPPFilter.java:128)
at org.apache.tools.ant.filters.BaseFilterReader.read(BaseFilterReader.java:124)
at org.apache.velocity.runtime.parser.VelocityCharStream.FillBuff(VelocityCharStream.java:118)
at org.apache.velocity.runtime.parser.VelocityCharStream.readChar(VelocityCharStream.java:199)
at org.apache.velocity.runtime.parser.VelocityCharStream.BeginToken(VelocityCharStream.java:140)
at org.apache.velocity.runtime.parser.ParserTokenManager.getNextToken(ParserTokenManager.java:3393)
at org.apache.velocity.runtime.parser.Parser.getToken(Parser.java:3327)
at org.apache.velocity.runtime.parser.node.SimpleNode.jjtOpen(SimpleNode.java:103)
at org.apache.velocity.runtime.parser.JJTParserState.openNodeScope(JJTParserState.java:82)
at org.apache.velocity.runtime.parser.Parser.process(Parser.java:218)
at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:103)
at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:759)
at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:703)
at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:324)
at foundrylogic.vpp.VPPFilter.preprocess(VPPFilter.java:225)
at foundrylogic.vpp.VPPFilter.read(VPPFilter.java:128)
at org.apache.tools.ant.filters.BaseFilterReader.read(BaseFilterReader.java:124)
at java.io.BufferedReader.read1(BufferedReader.java:180)
at java.io.BufferedReader.read(BufferedReader.java:256)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:652)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:352)
at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:645)
at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:449)
at foundrylogic.vpp.VPP.execute(VPP.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:303)
at org.apache.tools.ant.Task.perform(Task.java:401)
at org.apache.tools.ant.Target.execute(Target.java:338)
at org.apache.tools.ant.Target.performTasks(Target.java:365)
at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:415)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:144)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:303)
at org.apache.tools.ant.Task.perform(Task.java:401)
at org.apache.tools.ant.Target.execute(Target.java:338)
at org.apache.tools.ant.Target.performTasks(Target.java:365)
at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:220)
at org.apache.tools.ant.Main.start(Main.java:184)
at org.apache.tools.ant.Main.main(Main.java:267)
This is the hunk of build.xml (which is being called from an <antcall> with inheritAll=false:
I'm pretty sure that this is a bug in vpp. Essentially the problem is that 1.6b2 is calling one of the constructors of VPPFilter that doesn't init the fileUtils variable. This might have something to do with a change in how filters are managed and resused between 1.5.x and 1.6.x, since this didn't come up before.
I believe that I have this fixed, but I need to get time to test against 1.6b2 and package it up. The next release will be a 2.0.0 release and will have many more features and configurations possible.
didge
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I haven't yet reduced this down to a simple test case, so I won't file a bug yet (and it could be a problem with ant 1.6), but with one of my build files, I am using the VPP task (pretty much as illustrated in the examples) to generate some files. Works fine on ant 1.5.3, but doesn't work on ant 1.6b2. The stack trace in dicates a null pointer on VPPFilter.prepreprocess(), on the line:
File prepFile = fileUtils.createTempFile("out", "vpp", parentDir);
This is the whole exception below. (Don't mind the line numbers in VPPFilter; I added some debugging of my own to track it down). Notice that it goes through preprocess twice. With the debugging added and ant 1.5.3, it does not run preprocess twice; just once. With ant 1.6, the first time the reference to fileUtils looks okay; the 2nd time through it's null and the null pointer occurs:
Tue Nov 04 09:51:01 PST 2003 [error] Parser Error: vpp : java.lang.NullPointerException
at foundrylogic.vpp.VPPFilter.preprocess(VPPFilter.java:219)
at foundrylogic.vpp.VPPFilter.read(VPPFilter.java:128)
at org.apache.tools.ant.filters.BaseFilterReader.read(BaseFilterReader.java:124)
at org.apache.velocity.runtime.parser.VelocityCharStream.FillBuff(VelocityCharStream.java:118)
at org.apache.velocity.runtime.parser.VelocityCharStream.readChar(VelocityCharStream.java:199)
at org.apache.velocity.runtime.parser.VelocityCharStream.BeginToken(VelocityCharStream.java:140)
at org.apache.velocity.runtime.parser.ParserTokenManager.getNextToken(ParserTokenManager.java:3393)
at org.apache.velocity.runtime.parser.Parser.getToken(Parser.java:3327)
at org.apache.velocity.runtime.parser.node.SimpleNode.jjtOpen(SimpleNode.java:103)
at org.apache.velocity.runtime.parser.JJTParserState.openNodeScope(JJTParserState.java:82)
at org.apache.velocity.runtime.parser.Parser.process(Parser.java:218)
at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:103)
at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:759)
at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:703)
at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:324)
at foundrylogic.vpp.VPPFilter.preprocess(VPPFilter.java:225)
at foundrylogic.vpp.VPPFilter.read(VPPFilter.java:128)
at org.apache.tools.ant.filters.BaseFilterReader.read(BaseFilterReader.java:124)
at java.io.BufferedReader.read1(BufferedReader.java:180)
at java.io.BufferedReader.read(BufferedReader.java:256)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:652)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:352)
at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:645)
at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:449)
at foundrylogic.vpp.VPP.execute(VPP.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:303)
at org.apache.tools.ant.Task.perform(Task.java:401)
at org.apache.tools.ant.Target.execute(Target.java:338)
at org.apache.tools.ant.Target.performTasks(Target.java:365)
at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:415)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:144)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:303)
at org.apache.tools.ant.Task.perform(Task.java:401)
at org.apache.tools.ant.Target.execute(Target.java:338)
at org.apache.tools.ant.Target.performTasks(Target.java:365)
at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:220)
at org.apache.tools.ant.Main.start(Main.java:184)
at org.apache.tools.ant.Main.main(Main.java:267)
This is the hunk of build.xml (which is being called from an <antcall> with inheritAll=false:
<target name="_serverconfig">
<property file="staging.properties"/>
<vpp todir="template" overwrite="true">
<fileset dir="template/" includes="_serverconfig.vm"/>
<mapper type="glob" from="_serverconfig.vm" to="_serverconfig.sh"/>
<velocityProperty type="engine" key="runtime.log" value="vpp-sh.log"/>
<velocityProperty type="engine" key="file.resource.loader.path" value="template/config-xml"/>
</vpp>
</target>
Any obvious thoughts? If not, I'll poke around in the ant 1.6 source as well.
I'm pretty sure that this is a bug in vpp. Essentially the problem is that 1.6b2 is calling one of the constructors of VPPFilter that doesn't init the fileUtils variable. This might have something to do with a change in how filters are managed and resused between 1.5.x and 1.6.x, since this didn't come up before.
I believe that I have this fixed, but I need to get time to test against 1.6b2 and package it up. The next release will be a 2.0.0 release and will have many more features and configurations possible.
didge