velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ETsifrina <etsifr...@chessys.com>
Subject Re: ClassCastException
Date Thu, 03 May 2007 22:26:43 GMT

We've upgraded to Velocity 1.5 and Velocity Tools 1.3 (we were using 1.1
before).
The exception still persists.

More info:
The exception is reproducible only with large datasets (we have 7400
entries), but not with 2-200 entries.
It appears to have something to do with nested formatting as in:

$formatter.fixedWidth($formatter.currency($!{templateitem.Transaction.transAmount},2,true),16,true,0)

We haven't been able to pinpoint the problem to specific set of data -
failure appears random, but we can't confirm that.
Is there something special in the currency formatter in terms of not being
able to handle certain types of data?
Is there another way to achieve the nested functionality?
Is there anything else you can recommend?

Elena


Will Glass-Husain-2 wrote:
> 
> Try upgrading to Velocity 1.5.  We fixed several critical race conditions
> after that beta.
> 
> WILL
> 
> On 5/3/07, ETsifrina <etsifrina@chessys.com> wrote:
>>
>>
>> We are using velocity-1.5-beta1
>>
>>
>> Will Glass-Husain-2 wrote:
>> >
>> > What version of Velocity are you using?  Velocity 1.5 fixes a couple of
>> > race
>> > conditions that cause exceptions under high volume use.
>> >
>> > WILL
>> >
>> > On 5/2/07, ETsifrina <etsifrina@chessys.com> wrote:
>> >>
>> >>
>> >> We are using Velocity templates to export data from our app into a
>> file.
>> >> We are getting the following exception on occasion, however it is not
>> >> consistently reproducible.
>> >> We have checked the data, thinking that one of the more unual
>> characters
>> >> in
>> >> the data might be responsible, but to no avail.  Perhaps someone here
>> >> might
>> >> shed some light on the problem.
>> >>
>> >> Here is the export template that is used:
>> >> #set ($GLExportQueueItemglSignmap = {"D":"+","C":"-"})
>> >>
>> >> #foreach($templateitem in $templatecollection)
>> >> $formatter.substring($!{templateitem.Transaction.AccountIDNumber
>> >> },0,16)$formatter.date($!{templateitem.Transaction.postDate
>> >> },"yyyyMMdd")$formatter.date($!{templateitem.Transaction.effectiveDate
>> >> },"yyyyMMdd")$formatter.substring($!{
>> >> templateitem.Transaction.transactionType},0,2)$formatter.substring($!{
>> >> templateitem.Transaction.debitOrCredit
>> >> },0,1)$formatter.fixedWidth($formatter.currency($!{
>> >> templateitem.Transaction.transAmount
>> >> },2,true),16,true,0)$formatter.fixedWidth($!{
>> >> templateitem.Transaction.userRef1},16)$formatter.fixedWidth($!{
>> >> templateitem.Transaction.userRef2},16)$formatter.fixedWidth($!{
>> >> templateitem.Transaction.userRef3},16)$formatter.fixedWidth($!{
>> >> templateitem.Transaction.userRef4},16)$formatter.fixedWidth($!{
>> >> templateitem.Transaction.userRef5},16)$formatter.fixedWidth($!{
>> >> templateitem.Transaction.detailInfo},40)$formatter.substring($!{
>> >> templateitem.GLExportQueueItem.glAccountNumber
>> >> },0,40)$formatter.mapTool($GLExportQueueItemglSignmap,$!{
>> >> templateitem.GLExportQueueItem.glSign
>> >> })$formatter.fixedWidth($formatter.currency($!{
>> >> templateitem.GLExportQueueItem.glAmount
>> >> },2,true),16,true,0)$formatter.fixedWidth($!{
>> >> templateitem.Transaction.tranID},16,true,0)
>> >> #end
>> >>
>> >> Thanks in advance,
>> >>      Elena
>> >>
>> >>
>> >> sun.reflect.GeneratedMethodAccessor11176.invoke(Unknown Source)
>> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> >> java.lang.reflect.Method.invoke(Unknown Source)
>> >>
>> org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(
>> >> UberspectImpl.java:249)
>> >> org.apache.velocity.runtime.parser.node.ASTMethod.execute(
>> ASTMethod.java
>> >> :215)
>> >> org.apache.velocity.runtime.parser.node.ASTReference.execute(
>> >> ASTReference.java:181)
>> >> org.apache.velocity.runtime.parser.node.ASTReference.render(
>> >> ASTReference.java:229)
>> >> org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java
>> :57)
>> >> org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:414)
>> >> org.apache.velocity.runtime.parser.node.ASTDirective.render(
>> >> ASTDirective.java:117)
>> >> org.apache.velocity.runtime.parser.node.SimpleNode.render(
>> SimpleNode.java
>> >> :235)
>> >> org.apache.velocity.app.Velocity.evaluate(Velocity.java:287)
>> >> org.apache.velocity.app.Velocity.evaluate(Velocity.java:183)
>> >> ...
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/ClassCastException-tf3683800.html#a10296477
>> >> Sent from the Velocity - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> >> For additional commands, e-mail: user-help@velocity.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > Forio Business Simulations
>> >
>> > Will Glass-Husain
>> > wglass@forio.com
>> > www.forio.com
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/ClassCastException-tf3683800.html#a10305925
>> Sent from the Velocity - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
> 
> 
> -- 
> Forio Business Simulations
> 
> Will Glass-Husain
> wglass@forio.com
> www.forio.com
> 
> 

-- 
View this message in context: http://www.nabble.com/ClassCastException-tf3683800.html#a10314268
Sent from the Velocity - User mailing list archive at Nabble.com.


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


Mime
View raw message