Made *some* progress on this problem. Going through the mailing list
archives, I found a message from 6/13/01 indicating that extra blank lines
at the end of some of the Velocity templates can cause problems. The
segment listed below, taken out of that message from "Finn Smith"
[EMAIL PROTECTED] was the most telling. The bottom line is that removing
trailing blank lines from the *.vm files seems to fix the problem.
Why they're there in the first place, or why they only seem to cause trouble
for some users, is still a mystery to me.
-David
<snip>
After a lot of reading I:
(a) know a lot more about ant, torque, texen and velocity
(b) found the error in the template files that is causing this crash
Here's the diff of mssql/unique.vm to fix the problem <g>:
3a4
>
Explanation:
line 11 of mssql/table.vm stores the string in the $unique variable:
#set ( $unique = $generator.parse("$basepath/unique.vm", "", "table",
$tbl) )
line 14 of mssql/table.vm then takes that string, if it's empty it ignores
it, if not it chops off the trailing comma & space:
#if($unique.length()>0)$strings.chop($unique,2)#end
mssql/unique.vm has only three lines of code:
#foreach ($unique in $table.Unices)
UNIQUE ($unique.ColumnList),
#end
if there are no elements in $table.Unices when unique.vm is parsed at line
11 of mssql/table.vm the expectation is that it will evaluate to an empty
string. However, due to the fact that there is a blank line after the
#foreach ... #end loop in mssql/unique.vm it evaluates to a one character
string. Then when the check is performed in line 14 of mssql/table.vm the
length is greater than 0, but causes an array out of bounds exception when
chop tries to take 2 characters off the end.
Changing 0 to 1 and 2 to 3 in line 14 of mssql/table.vm fixes this as well,
but just deleting the extra line in mssql/unique.vm keeps the comparison
code in line 14 consistent with other *.vm files. It seems to me, however,
that there are several other places in the *.vm files where these types of
comparisons (if length > 0 then chop two chars) occur and that having some
sort of check and error message for the length == 1 case would be a good
idea. I don't really know Velocity. Maybe someone else would know the best
way to implement this.
</snip>
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 16, 2002 2:46 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: tutorial doesn't work
Thanks, but I don't think this is it. The default target is "main" which
causes targets "project-sql" and "project-om" to be called, neither of which
invokes the "project-create-db" target. Anyway, making the change listed
below has no effect.
-David
-----Original Message-----
From: Peter S. Hamlen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 16, 2002 1:33 PM
To: [EMAIL PROTECTED]
Subject: Re: tutorial doesn't work
David,
The latest tutorial has the following bit in it - I think this is your
problem:
Note: this will fail in the current beta version of Torque due to an
oversight that will be corrected in the next beta. The fix is relatively
simple, remove the following attributes from the project-create-db Ant
task in build.xml (don't delete the '>' on the databaseHost line!):
targetPlatform="${platform}"
databaseUser="${databaseUser}"
databasePassword="${databasePassword}"
databaseHost="${databaseHost}"
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>