{"id":4077,"date":"2014-03-30T07:27:24","date_gmt":"2014-03-30T07:27:24","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-velocity-collection-of-common-programming-errors\/"},"modified":"2014-03-30T07:27:24","modified_gmt":"2014-03-30T07:27:24","slug":"problem-about-velocity-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-velocity-collection-of-common-programming-errors\/","title":{"rendered":"problem about velocity-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dccdfca5029e4b07eaf70232f883270f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nFranz<br \/>\nlinux logging velocity<br \/>\nWhen instatiating Velocity I get this error (posted just the &#8220;caused by&#8221;-messages):java.lang.RuntimeException: Velocity could not be initialized! Caused by: org.apache.velocity.exception.VelocityException: Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration. Caused by: org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with t<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c938e635f9e3b38b23fd735b6a45ef56?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nArne Evertsson<br \/>\njava web-applications velocity<br \/>\nSomething is wrong and it is very frustrating. I read on velocity&#8217;s homepage that when I run a webapp then some properties should be set. And I&#8217;ve done that but no matter what I do I keep getting the same error. This is where I set the props and use velocitypublic class ConfirmationMailGenerator implements MailGenerator {private BasicUser user;private String htmlTemplate = &#8220;HTMLConfirmationMailTemplate.vsl&#8221;;private String plainTemplate = &#8220;PlainConfirmationMailTemplate.vsl&#8221;;public ConfirmationMa<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8de038497b6b8b67bc82eeaaef1a0b6b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBozho<br \/>\njava jsp velocity tiles freemarker<br \/>\nI&#8217;m about to choose to way to organize my view (with spring-mvc, but that shouldn&#8217;t matter much)There are 6 options as far as I see (though they are not mutually exclusive):tiles sitemesh freemarker velocity &lt;jsp:include&gt; &lt;%@ include file=&#8221;..&#8221;&gt;tiles and sitemesh can be grouped; so can freemarker and velocity. Which one within each group to use is not a matter of this discussion, there are enough questions and discussions about it.This is an interesting read, but can&#8217;t quite convince<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b36ba7eef70ce5e26120286b2e484c88?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ntodofixthis<br \/>\njava velocity<br \/>\nWhen i try to initialize velocity engine usingVelocityEngine engine = new VelocityEngine(); engine.init();I encounter the same error when i tryVelocity.init();org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.ServletLogChute with the current runtime configuration.What may cause this exception?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a007be5a61f6aa8f3e85ae2fc18dd66e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nCommunity<br \/>\njava liferay velocity<br \/>\nAre all vm files of the theme executed each time a page is requested? Maybe custom_init.vm is executed only once per session or some other optimizations occur?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/81e48a450b7108d5b6f4867fd1d094ba?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nbobber205<br \/>\napache velocity<br \/>\nWanting to do some fancy stuff&#8230; \ud83d\ude1b We&#8217;d like to be able to pass a string that IS the file, instead of a string that simple a filename. We&#8217;re going to create a file in memory using a string\/stringbuffer and we want the velocity engine to act upon that instead of reading in a file.Does this function exist?Many thanks!<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ca56149fb5e6eb0fd0dc7f1bbd576d76?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJos\u00e9 Leal<br \/>\njava servlets log4j stack-trace velocity<br \/>\nI built a webapp that works perfectly fine in my localhost (tomcat). But when I tried to deploy, velocity crashes in init(), leaving me with this strange stack trace here (sorry for the size):ERROR [main] (VelocityConfigurator.java:62) &#8211; Error initializing Velocity! org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.at org.apache.velocity.runtime.log.LogManager.createLogChute(Lo<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9f0b1ed2a669b745e39f7b1ff63e9888?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1487380<br \/>\njavascript themes liferay portlet velocity<br \/>\nI try to include my customizing Navigation portlet to first column of my themes So I had tried to use following code in my layout template: (\\ROOT\\layouttpl\\custom\\3_columns.tpl)$velocityPortletPreferences.setValue(&#8220;portlet-setup-show-borders&#8221;, &#8220;false&#8221;) $theme.runtime(&#8220;71_INSTANCE_MAIN&#8221;, &#8220;&#8221;, $velocityPortletPreferences.toString()) $velocityPortletPreferences.reset() It work fine, expect, When enter Manage-&gt;Page, and select one pages in pages tree (diffrent of current page) then select Layout on<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5f857484108693718d23311beca90cc8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBastl<br \/>\njava spring xslt velocity xdoclet<br \/>\nI am about to generate a reference documentation for a big bunch of spring-beans that are configured and assembled at runtime. The basis for the documentation is javadoc.In the first step I collect a map of classname &lt;-&gt; raw-class-documentation using a simple doclet.Then I launch the spring container and find all those beans that I am interested in.Now I want to render the documents, but I need guidance with toolset and data-modeling.1) The actual datamodel does not reflect what I want to doc<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7613104663f0577cc77334e806fc1a6a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJyothis<br \/>\njava string reflection velocity<br \/>\nIs there any String replacement mechanism in Java, where I can pass objects with a text, and it replaces the string as it occurs. For example, the text is :Hello ${user.name},Welcome to ${site.name}. The objects I have are &#8220;user&#8221; and &#8220;site&#8221;. I want to replace the strings given inside ${} with its equivalent values from the objects. This is same as we replace objects in a velocity template.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/eadcd064b4d982c984832536f2a4fd3e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nema<br \/>\nspring view velocity<br \/>\nI have a spring mvc project.For views firstly i used jsp and it worked fine, but then i wanted to use velocity and got exception.Both views are similar except of syntax.I can&#8217;t understand why it happens. That&#8217;s my jsp:&lt;form:form action=&#8221;updateDepartament&#8221; modelAttribute=&#8221;editDepartament&#8221; method=&#8221;POST&#8221;&gt; &lt;table&gt; &lt;tr&gt;&lt;td&gt;Id:&lt;\/td&gt;&lt;td&gt;&lt;form:input path=&#8221;departamentId&#8221; readonly=&#8221;true&#8221;\/&gt;&lt;\/td&gt;&lt;\/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;spring:m<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d8206b3ff36c7985108359f97562a9a4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nCory Kendall<br \/>\njava spring-mvc velocity<br \/>\nI try add javascript to my velocity template. &lt;html&gt;&lt;head&gt; &lt;title&gt;:: $currency.CurrencyName Detail Info ::&lt;\/title&gt; &lt;\/head&gt;&lt;body&gt; &lt;table&gt;&lt;tr&gt;&lt;td&gt;Name&lt;\/td&gt;&lt;td&gt;$currency.CurrencyName&lt;\/td&gt;&lt;\/tr&gt;&lt;tr&gt;&lt;td&gt;Jual&lt;\/td&gt;&lt;td&gt;&lt;div id=&#8221;$currency.CurrencyName_buy&#8221;&gt;$currency.Buy&lt;\/div&gt;&lt;\/td&gt;&lt;\/tr&gt;&lt;tr&gt;&lt;td&gt;Beli&lt;\/td&gt;&lt;td&gt;&lt;div id=&#8221;$currency.CurrencyName_sell&#8221;&gt;$curr<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fe820a89430427e8e3023d8450dd72f0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nLyudmil<br \/>\njava velocity<br \/>\nOur team has been experiencing a recurring problem with velocity templates. Upon rendering, some throw a RuntimeException with the message &#8220;Template.merge() failure &#8211; Unable to render Velocity Template, &#8216;\/template.vm'&#8221;. We have not been able to reproduce the problem and the documentation on the web is pretty insufficient. The problem is not consistently reproducible &#8211; the same templates whose rendering sometimes causes the error also manage to display without problems at other times. The Templat<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/587072c7d381796d8f233d2137be57b4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMikaveli<br \/>\njava regex ascii velocity<br \/>\nI&#8217;m trying to remove undesirable characters from a string in Velocity (newlines are ok, but not things like EM and CAN ASCII control characters).#set($cleanScreen = $cleanScreen.replaceAll(&#8220;\\p{Cc}&#8221;, &#8220;&#8221;))Throws:org.apache.velocity.exception.ParseErrorException: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 13, column 82. Encountered: &#8220;p&#8221; (112), after : &#8220;\\&#8221;\\\\&#8221;at org.apache.velocity.Template.process(Template.java:137)at org.apache.velocity.runtime.resource.<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Franz linux logging velocity When instatiating Velocity I get this error (posted just the &#8220;caused by&#8221;-messages):java.lang.RuntimeException: Velocity could not be initialized! Caused by: org.apache.velocity.exception.VelocityException: Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration. Caused by: org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with t Arne Evertsson java web-applications [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4077","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4077"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4077\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}