0

In a clustered environment where multiple tomcat is running under a Load Balancer, we encountered an issue which we assumed could be a velocity engine which needs some kind of configuration as the environment moved from simple node to clustered.

This is how it is encountered to me and can be reproduced if I follow the following steps. The steps are; for instance, in an development environment of clustering a developer has two different (virtual) servers and each server tomcat communicating with the other sending serialized sessions and the other one de-serialized on it's end. This way both server having same session if one is down (or not responded) the other server will take care of the request. The users session sustain and any kind of server failure don't cause user to annoy.

Suppose while browsing the application in the browser you are being observer the 'catalina.out' log of each server. There will be a server which will be getting all your requests served and the other one is just sync the session (in standby). You killed the tomcat of the server where all your requests being served and now it the standby server is ready to server you. You browse through a to a page where you can search records initially the page is showing empty. Once, you hit the search you see 3 records but every row column first column has something weird:

Names                                      |  Last Logged in Time
_________________________________________________________________________________
 #dotPaddingWithoutTitle(Amir Ali, 60)     |  10/11/2012 6:00 PM
 #dotPaddingWithoutTitle(Saif Uddin, 60)   |  10/11/2012 6:00 PM
 #dotPaddingWithoutTitle(Reemsha Ayaz, 60) |  10/11/2012 6:00 PM

#dotPaddingWithoutTitle is a velocity macro; seems it is unable to render it in such scenario but I couldn't understand why the whole view (header, footer, navigation, toolbar etc.) are able to rendered but not this.

If you have any idea about it please help on this. Thanks.

Ramiz Uddin
  • 4,249
  • 4
  • 40
  • 72
  • You need to provide more details. Posting velocity macro would definitely help. If these Velocity macros contain server-side objects, explanation what does what would also be useful. – mindas Nov 26 '12 at 10:15
  • @mindas There is no server-side objects in this macro all it does is restrict the title to 60 characters and add up 1 pad on each side of the title – Ramiz Uddin Nov 27 '12 at 04:57
  • I have actually no clue, but posting *all* velocity configuration may help. Specially where and how are velocimacros read. – sinuhepop Nov 27 '12 at 09:25
  • @sinuhepop could you please tell me how to configure velocimacros in velocity.properties using spring when all your macros resides in /WEB-INF/classes/vm/snippets/macroutils.vm – Ramiz Uddin Nov 27 '12 at 10:26
  • I've found Spring's **VelocityConfigurer** incomplete so I always used my own bean factory. But I think you must use its **velocityProperties** field like **velocity.properties** file. – sinuhepop Nov 27 '12 at 10:57

1 Answers1

2

*try to upgrade velocity framework (velocity-1.7), i hope it will solve your problem... more details can be found here *

Sunny
  • 174
  • 7