JavaScud | Forum | JIRA | Blog |
  Dashboard > WebWork2文档中文化计划 > ... > FAQ > I'm trying to run the webwork example in the tutorial on Tomcat, and it can't instantiate the VelocityEngine
  WebWork2文档中文化计划 Log In View a printable version of the current page.  
  I'm trying to run the webwork example in the tutorial on Tomcat, and it can't instantiate the VelocityEngine
Added by scud, last edited by scud on Mar 30, 2006  (view change)
Labels: 
(None)

Tomcat says:

javax.servlet.ServletException: Servlet.init() for servlet webwork threw exception at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:963)
...
root cause

java.lang.RuntimeException: Unable to instantiate VelocityEngine!
at
com.opensymphony.webwork.views.velocity.VelocityManager.newVelocityEngine(VelocityManager.java:333)
at
com.opensymphony.webwork.views.velocity.VelocityManager.init(VelocityManager.java:146)
at
com.opensymphony.webwork.dispatcher.ServletDispatcher.init(ServletDispatcher.java:177)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)

Solution: (thanks to Keith Lea)

It turns out Velocity's Avalon logging system was trying to write to my tomcat folder.

So that it's on file somewhere for other people, I will describe the solution:

I created a file "velocity.properties" and placed it in my WEB-INF/classes folder. Inside the file I wrote:

runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogSystem

This stops velocity from logging, and makes webwork work again.

Site running on a free Atlassian Confluence Open Source Project License granted to WebWork China. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.3 Build:#808 May 29, 2007) - Bug/feature request - Contact Administrators